Bug 1378973 - label mscom's MainThreadRelease runnable; r=billm
authorNathan Froyd <froydnj@mozilla.com>
Tue, 25 Jul 2017 11:17:32 -0400
changeset 419587 979cc414d80a9964cb62ff03b72859e5fcb20a40
parent 419586 2bb6be91be3978952ba4b12272afa251b6e6a3d7
child 419588 a18e17f0c0b6d08a8817c3e00a5a9e87130c6cca
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbillm
bugs1378973
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 1378973 - label mscom's MainThreadRelease runnable; r=billm These pointers don't touch things in the DOM, so SystemGroup is fine for releasing them.
ipc/mscom/Ptr.h
--- a/ipc/mscom/Ptr.h
+++ b/ipc/mscom/Ptr.h
@@ -5,16 +5,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_mscom_Ptr_h
 #define mozilla_mscom_Ptr_h
 
 #include "mozilla/Assertions.h"
 #include "mozilla/DebugOnly.h"
 #include "mozilla/mscom/EnsureMTA.h"
+#include "mozilla/SystemGroup.h"
 #include "mozilla/UniquePtr.h"
 #include "nsError.h"
 #include "nsThreadUtils.h"
 #include "nsXULAppAPI.h"
 
 /**
  * The glue code in mozilla::mscom often needs to pass around interface pointers
  * belonging to a different apartment from the current one. We must not touch
@@ -36,19 +37,20 @@ struct MainThreadRelease
     if (!aPtr) {
       return;
     }
     if (NS_IsMainThread()) {
       aPtr->Release();
       return;
     }
     DebugOnly<nsresult> rv =
-      NS_DispatchToMainThread(NewNonOwningRunnableMethod("mscom::MainThreadRelease",
-                                                         aPtr,
-                                                         &T::Release));
+      SystemGroup::Dispatch("mscom::MainThreadRelease",
+                            TaskCategory::Other,
+                            NewNonOwningRunnableMethod("mscom::MainThreadRelease",
+                                                       aPtr, &T::Release));
     MOZ_ASSERT(NS_SUCCEEDED(rv));
   }
 };
 
 template <typename T>
 struct MTADelete
 {
   void operator()(T* aPtr)