From e07f6aabbe877315688b586c09a36cbe02b7a2a1 Mon Sep 17 00:00:00 2001 From: Steve Block Date: Mon, 28 Jun 2010 10:25:04 +0100 Subject: Pass the WebView context to the GeolocationService from WebKit Bug: 2798745 Change-Id: I429a1cb9fc6826419c62f1f30376692ede497085 --- WebCore/platform/android/GeolocationServiceBridge.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'WebCore/platform/android/GeolocationServiceBridge.cpp') diff --git a/WebCore/platform/android/GeolocationServiceBridge.cpp b/WebCore/platform/android/GeolocationServiceBridge.cpp index be68193..837b338 100644 --- a/WebCore/platform/android/GeolocationServiceBridge.cpp +++ b/WebCore/platform/android/GeolocationServiceBridge.cpp @@ -26,6 +26,7 @@ #include "config.h" #include "GeolocationServiceBridge.h" +#include "Frame.h" #include "GeolocationServiceAndroid.h" #include "Geoposition.h" #include "PositionError.h" @@ -70,12 +71,12 @@ enum javaLocationClassMethods { }; static jmethodID javaLocationClassMethodIDs[LocationMethodCount]; -GeolocationServiceBridge::GeolocationServiceBridge(ListenerInterface* listener) +GeolocationServiceBridge::GeolocationServiceBridge(ListenerInterface* listener, Frame* frame) : m_listener(listener) , m_javaGeolocationServiceObject(0) { ASSERT(m_listener); - startJavaImplementation(); + startJavaImplementation(frame); } GeolocationServiceBridge::~GeolocationServiceBridge() @@ -165,7 +166,7 @@ PassRefPtr GeolocationServiceBridge::toGeoposition(JNIEnv *env, con env->CallLongMethod(location, javaLocationClassMethodIDs[LocationMethodGetTime])); } -void GeolocationServiceBridge::startJavaImplementation() +void GeolocationServiceBridge::startJavaImplementation(Frame* frame) { JNIEnv* env = getJNIEnv(); @@ -175,7 +176,7 @@ void GeolocationServiceBridge::startJavaImplementation() // Set up the methods we wish to call on the Java GeolocationService class. javaGeolocationServiceClassMethodIDs[GeolocationServiceMethodInit] = - env->GetMethodID(javaGeolocationServiceClass, "", "(J)V"); + env->GetMethodID(javaGeolocationServiceClass, "", "(Landroid/content/Context;J)V"); javaGeolocationServiceClassMethodIDs[GeolocationServiceMethodStart] = env->GetMethodID(javaGeolocationServiceClass, "start", "()Z"); javaGeolocationServiceClassMethodIDs[GeolocationServiceMethodStop] = @@ -187,6 +188,7 @@ void GeolocationServiceBridge::startJavaImplementation() jlong nativeObject = reinterpret_cast(this); jobject object = env->NewObject(javaGeolocationServiceClass, javaGeolocationServiceClassMethodIDs[GeolocationServiceMethodInit], + android::WebViewCore::getWebViewCore(frame->view())->getContext(), nativeObject); m_javaGeolocationServiceObject = getJNIEnv()->NewGlobalRef(object); -- cgit v1.1