Bug 964813 - Make HandleUncaughtException JNI wrapper multithreaded; r=kats
authorJim Chen <nchen@mozilla.com>
Tue, 28 Jan 2014 18:32:28 -0600
changeset 165654 ba1d3a43ab927868f54dc44872bb71b92ebd85b3
parent 165653 45db690af8c63188c448bd3a9648e13aa1d6f8c8
child 165655 6f90f9c6b49d02847819710e2c7942fb93064a5d
push id39012
push usernchen@mozilla.com
push dateWed, 29 Jan 2014 00:33:48 +0000
treeherdermozilla-inbound@ba1d3a43ab92 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs964813
milestone29.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 964813 - Make HandleUncaughtException JNI wrapper multithreaded; r=kats
mobile/android/base/GeckoAppShell.java
widget/android/GeneratedJNIWrappers.cpp
--- a/mobile/android/base/GeckoAppShell.java
+++ b/mobile/android/base/GeckoAppShell.java
@@ -388,17 +388,17 @@ public class GeckoAppShell
 
     // Tell the Gecko event loop that an event is available.
     public static native void notifyGeckoOfEvent(GeckoEvent event);
 
     /*
      *  The Gecko-side API: API methods that Gecko calls
      */
 
-    @WrapElementForJNI(generateStatic = true, noThrow = true)
+    @WrapElementForJNI(allowMultithread = true, generateStatic = true, noThrow = true)
     public static void handleUncaughtException(Thread thread, Throwable e) {
         if (thread == null) {
             thread = Thread.currentThread();
         }
         // If the uncaught exception was rethrown, walk the exception `cause` chain to find
         // the original exception so Socorro can correctly collate related crash reports.
         Throwable cause;
         while ((cause = e.getCause()) != null) {
--- a/widget/android/GeneratedJNIWrappers.cpp
+++ b/widget/android/GeneratedJNIWrappers.cpp
@@ -714,17 +714,17 @@ jstring GeckoAppShell::HandleGeckoMessag
 
     jobject temp = env->CallStaticObjectMethod(mGeckoAppShellClass, jHandleGeckoMessageWrapper, j0);
     AndroidBridge::HandleUncaughtException(env);
     jstring ret = static_cast<jstring>(env->PopLocalFrame(temp));
     return ret;
 }
 
 void GeckoAppShell::HandleUncaughtException(jobject a0, jthrowable a1) {
-    JNIEnv *env = AndroidBridge::GetJNIEnv();
+    JNIEnv *env = GetJNIForThread();
     if (env->PushLocalFrame(2) != 0) {
         return;
     }
 
     env->CallStaticVoidMethod(mGeckoAppShellClass, jHandleUncaughtException, a0, a1);
     env->PopLocalFrame(nullptr);
 }