Bug 1372405 - Change SchedulerGroup::GetName so it doesn't delegate to mozilla::Runnable (r=froydnj)
☠☠ backed out by af979c2baf41 ☠ ☠
authorBill McCloskey <billm@mozilla.com>
Thu, 15 Jun 2017 16:26:25 -0700
changeset 365275 ce7c27a7a91e7e6a0ecea5e29c3b485fbfac4a84
parent 365274 7bc0766b6a76f97552520aafad3af0dda2e1cf50
child 365276 4f6302a98ae41ff2d57c768996d1edbb0afda73a
push id32068
push userkwierso@gmail.com
push dateThu, 22 Jun 2017 00:58:38 +0000
treeherdermozilla-central@f8bb96fb5c4f [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());