Bug 1390076 - Label MainThreadInvoker using SystemGroup. r=aklotz
authorBevis Tseng <btseng@mozilla.com>
Mon, 28 Aug 2017 14:11:38 +0800
changeset 379446 75b91420fff7c1ded50cc8dd9396590bc0172588
parent 379445 df28182add1cd6be822246125e30b128f97b4a91
child 379447 e4fe078dc0134815c9e19e671ab3d3ea69979955
push id50642
push userarchaeopteryx@coole-files.de
push dateThu, 07 Sep 2017 10:41:07 +0000
treeherderautoland@bd0ce93776fe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaklotz
bugs1390076
milestone57.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 1390076 - Label MainThreadInvoker using SystemGroup. r=aklotz
ipc/mscom/MainThreadInvoker.cpp
--- a/ipc/mscom/MainThreadInvoker.cpp
+++ b/ipc/mscom/MainThreadInvoker.cpp
@@ -9,16 +9,17 @@
 #include "GeckoProfiler.h"
 #include "MainThreadUtils.h"
 #include "mozilla/Assertions.h"
 #include "mozilla/ClearOnShutdown.h"
 #include "mozilla/DebugOnly.h"
 #include "mozilla/HangMonitor.h"
 #include "mozilla/mscom/SpinEvent.h"
 #include "mozilla/RefPtr.h"
+#include "mozilla/SystemGroup.h"
 #include "private/prpriv.h" // For PR_GetThreadID
 #include "WinUtils.h"
 
 namespace {
 
 /**
  * SyncRunnable implements different code paths depending on whether or not
  * we are running on a multiprocessor system. In the multiprocessor case, we
@@ -104,17 +105,18 @@ MainThreadInvoker::Invoke(already_AddRef
 
   if (NS_IsMainThread()) {
     runnable->Run();
     return true;
   }
 
   RefPtr<SyncRunnable> syncRunnable = new SyncRunnable(runnable.forget());
 
-  if (NS_FAILED(NS_DispatchToMainThread(syncRunnable, nsIEventTarget::DISPATCH_NORMAL))) {
+  if (NS_FAILED(SystemGroup::Dispatch(
+                  TaskCategory::Other, do_AddRef(syncRunnable)))) {
     return false;
   }
 
   // This ref gets released in MainThreadAPC when it runs.
   SyncRunnable* syncRunnableRef = syncRunnable.get();
   NS_ADDREF(syncRunnableRef);
   if (!::QueueUserAPC(&MainThreadAPC, sMainThread,
                       reinterpret_cast<UINT_PTR>(syncRunnableRef))) {