Bug 1189058 - Don't spin the Event loop while setting up WebRTC + Java. r=snorp
authorGian-Carlo Pascutto <gcp@mozilla.com>
Thu, 30 Jul 2015 19:53:38 +0200
changeset 287433 de87db481f88d394f60625913d47e5fc861b7d63
parent 287432 ca56c20306dfcc49fccbee48817a318f1ef15ad8
child 287434 b2db9b75841ac542d9778413aa452fc2d452555e
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssnorp
bugs1189058
milestone42.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 1189058 - Don't spin the Event loop while setting up WebRTC + Java. r=snorp
widget/android/AndroidJNIWrapper.cpp
--- a/widget/android/AndroidJNIWrapper.cpp
+++ b/widget/android/AndroidJNIWrapper.cpp
@@ -4,16 +4,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include <android/log.h>
 #include <dlfcn.h>
 #include <prthread.h>
 
 #include "mozilla/DebugOnly.h"
 #include "mozilla/Assertions.h"
+#include "mozilla/SyncRunnable.h"
 #include "nsThreadUtils.h"
 #include "AndroidBridge.h"
 
 extern "C" {
   jclass __jsjni_GetGlobalClassRef(const char *className);
 }
 
 class GetGlobalClassRefRunnable : public nsRunnable {
@@ -61,17 +62,18 @@ extern "C" {
 
     nsCOMPtr<nsIThread> mainThread;
     mozilla::DebugOnly<nsresult> rv = NS_GetMainThread(getter_AddRefs(mainThread));
     MOZ_ASSERT(NS_SUCCEEDED(rv));
 
     jclass foundClass;
     nsCOMPtr<nsIRunnable> runnable_ref(new GetGlobalClassRefRunnable(className,
                                                                      &foundClass));
-    mainThread->Dispatch(runnable_ref, NS_DISPATCH_SYNC);
+    nsRefPtr<mozilla::SyncRunnable> sr = new mozilla::SyncRunnable(runnable_ref);
+    sr->DispatchToThread(mainThread);
     if (!foundClass)
       return nullptr;
 
     return foundClass;
   }
 
   __attribute__ ((visibility("default")))
   jmethodID