Bug 1372405 - Change SchedulerGroup::GetName so it doesn't delegate to mozilla::Runnable (r=froydnj)
☠☠ backed out by 0f30b67d296a ☠ ☠
authorBill McCloskey <billm@mozilla.com>
Thu, 15 Jun 2017 16:26:25 -0700
changeset 364865 301e80f200463e138a5a532ffeabebddee79b9de
parent 364864 89963ba78c353b23feab0042ebe264049f8d4533
child 364866 9846de3bd9545fb2c2b803a36af85568ccf2473b
push id32057
push userkwierso@gmail.com
push dateWed, 21 Jun 2017 00:59:08 +0000
treeherdermozilla-central@f31652d75fb5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1372405
milestone56.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1372405 - Change SchedulerGroup::GetName so it doesn't delegate to mozilla::Runnable (r=froydnj) Delegating to mozilla::Runnable caused us to return the wrong value once SchedulerGroup started passing a non-empty name to the Runnable constructor. MozReview-Commit-ID: 2zMlpiMnHwv
xpcom/threads/SchedulerGroup.cpp
--- a/xpcom/threads/SchedulerGroup.cpp
+++ b/xpcom/threads/SchedulerGroup.cpp
@@ -334,27 +334,25 @@ SchedulerGroup::Runnable::Runnable(alrea
  : mRunnable(Move(aRunnable)),
    mGroup(aGroup)
 {
 }
 
 NS_IMETHODIMP
 SchedulerGroup::Runnable::GetName(nsACString& aName)
 {
-  mozilla::Runnable::GetName(aName);
+  // Try to get a name from the underlying runnable.
+  nsCOMPtr<nsINamed> named = do_QueryInterface(mRunnable);
+  if (named) {
+    named->GetName(aName);
+  }
   if (aName.IsEmpty()) {
-    // Try to get a name from the underlying runnable.
-    nsCOMPtr<nsINamed> named = do_QueryInterface(mRunnable);
-    if (named) {
-      named->GetName(aName);
-    }
-    if (aName.IsEmpty()) {
-      aName.AssignLiteral("anonymous");
-    }
+    aName.AssignLiteral("anonymous");
   }
+
   aName.AppendASCII("(labeled)");
   return NS_OK;
 }
 
 NS_IMETHODIMP
 SchedulerGroup::Runnable::Run()
 {
   MOZ_RELEASE_ASSERT(NS_IsMainThread());