Bug 1186467 - Rewrite NativeJSContainer to use new native JNI scheme; r=snorp

This patch makes NativeJSContainer use per-instance native methods.
NativeJSContainer is also updated to use smart JNI reference classes.
This commit is contained in:
Jim Chen 2015-08-04 17:47:28 -04:00
parent cf40f969b5
commit ff569cc4b6
3 changed files with 755 additions and 889 deletions

View File

@ -1066,9 +1066,7 @@ AndroidBridge::HandleGeckoMessage(JSContext* cx, JS::HandleObject object)
{
ALOG_BRIDGE("%s", __PRETTY_FUNCTION__);
JNIEnv* const env = GetJNIEnv();
auto message = Object::LocalRef::Adopt(env,
mozilla::widget::CreateNativeJSContainer(env, cx, object));
auto message = mozilla::widget::CreateNativeJSContainer(cx, object);
GeckoAppShell::HandleGeckoMessageWrapper(message);
}

File diff suppressed because it is too large Load Diff

View File

@ -6,13 +6,14 @@
#ifndef NativeJSObject_h__
#define NativeJSObject_h__
#include <jni.h>
#include "GeneratedJNIWrappers.h"
#include "jsapi.h"
namespace mozilla {
namespace widget {
jobject CreateNativeJSContainer(JNIEnv* env, JSContext* cx, JS::HandleObject object);
NativeJSContainer::LocalRef CreateNativeJSContainer(
JSContext* cx, JS::HandleObject object);
} // namespace widget
} // namespace mozilla