From 2917534d5463c3d95ba2d04dbc39b36b6dfb303f Mon Sep 17 00:00:00 2001 From: Andrei Popescu Date: Thu, 3 Sep 2009 20:37:48 +0100 Subject: [PATCH] Allow 0 to be passed for the nativePointerParameter to nativeAddJavaScriptInterface. When 0, we add the iface to the top level frame. --- WebKit/android/jni/WebCoreFrameBridge.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/WebKit/android/jni/WebCoreFrameBridge.cpp b/WebKit/android/jni/WebCoreFrameBridge.cpp index 418af49a9..1160eed06 100644 --- a/WebKit/android/jni/WebCoreFrameBridge.cpp +++ b/WebKit/android/jni/WebCoreFrameBridge.cpp @@ -1056,7 +1056,11 @@ static void AddJavascriptInterface(JNIEnv *env, jobject obj, jint nativeFramePoi #ifdef ANDROID_INSTRUMENT TimeCounterAuto counter(TimeCounter::NativeCallbackTimeCounter); #endif - WebCore::Frame* pFrame = (WebCore::Frame*)nativeFramePointer; + WebCore::Frame* pFrame = 0; + if (nativeFramePointer == 0) + pFrame = GET_NATIVE_FRAME(env, obj); + else + pFrame = (WebCore::Frame*)nativeFramePointer; LOG_ASSERT(pFrame, "nativeAddJavascriptInterface must take a valid frame pointer!"); JavaVM* vm; -- 2.11.0