Bug 1189058 - Don't spin the Event loop while setting up WebRTC + Java. r=snorp, a=sledru FIREFOX_RELEASE_40_BASE
authorGian-Carlo Pascutto <gcp@mozilla.com>
Thu, 30 Jul 2015 19:53:38 +0200
changeset 291362 34e00eb800c52e33059d37f6e41fb255b4bae6b8
parent 291361 525d29ba77a74fb822674d2e3ce2ec7ee04b72fa
child 291363 692d9f3fe5a8183cc45282d772c41fc593e63fe7
push id5246
push usermozilla@noorenberghe.ca
push dateWed, 09 Sep 2015 21:17:14 +0000
reviewerssnorp, sledru
bugs1189058
milestone40.0
Bug 1189058 - Don't spin the Event loop while setting up WebRTC + Java. r=snorp, a=sledru CLOSED TREE
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