Allow 0 to be passed for the nativePointerParameter to nativeAddJavaScriptInterface. When 0, we add the iface to the top level frame.
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 @@
#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;