diff options
author | Andrei Popescu <andreip@google.com> | 2009-09-03 20:37:48 +0100 |
---|---|---|
committer | Andrei Popescu <andreip@google.com> | 2009-09-03 22:33:21 +0100 |
commit | 2917534d5463c3d95ba2d04dbc39b36b6dfb303f (patch) | |
tree | 78b59d53bc7aec15d3b65a269faa8303b2d90e3a /WebKit | |
parent | 5188b9fc3b8f6aa797c9d97bb0aa30ab67f98265 (diff) | |
download | external_webkit-2917534d5463c3d95ba2d04dbc39b36b6dfb303f.zip external_webkit-2917534d5463c3d95ba2d04dbc39b36b6dfb303f.tar.gz external_webkit-2917534d5463c3d95ba2d04dbc39b36b6dfb303f.tar.bz2 |
Allow 0 to be passed for the nativePointerParameter to nativeAddJavaScriptInterface. When 0, we add the iface to the top level frame.
Diffstat (limited to 'WebKit')
-rw-r--r-- | WebKit/android/jni/WebCoreFrameBridge.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/WebKit/android/jni/WebCoreFrameBridge.cpp b/WebKit/android/jni/WebCoreFrameBridge.cpp index 418af49..1160eed 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; |