diff options
author | Steve Block <steveblock@google.com> | 2010-06-28 10:25:04 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2010-06-29 12:29:10 +0100 |
commit | e07f6aabbe877315688b586c09a36cbe02b7a2a1 (patch) | |
tree | 4a8d4500cfb3b5781b3067305faeca3fbd8e58e9 /WebCore/platform/android/GeolocationServiceBridge.cpp | |
parent | a3054d2b31d3e00563e3865d398ef93d25b8b2e0 (diff) | |
download | external_webkit-e07f6aabbe877315688b586c09a36cbe02b7a2a1.zip external_webkit-e07f6aabbe877315688b586c09a36cbe02b7a2a1.tar.gz external_webkit-e07f6aabbe877315688b586c09a36cbe02b7a2a1.tar.bz2 |
Pass the WebView context to the GeolocationService from WebKit
Bug: 2798745
Change-Id: I429a1cb9fc6826419c62f1f30376692ede497085
Diffstat (limited to 'WebCore/platform/android/GeolocationServiceBridge.cpp')
-rw-r--r-- | WebCore/platform/android/GeolocationServiceBridge.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
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<Geoposition> 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, "<init>", "(J)V"); + env->GetMethodID(javaGeolocationServiceClass, "<init>", "(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<jlong>(this); jobject object = env->NewObject(javaGeolocationServiceClass, javaGeolocationServiceClassMethodIDs[GeolocationServiceMethodInit], + android::WebViewCore::getWebViewCore(frame->view())->getContext(), nativeObject); m_javaGeolocationServiceObject = getJNIEnv()->NewGlobalRef(object); |