diff options
| author | Steve Block <steveblock@google.com> | 2010-02-18 11:26:48 +0000 |
|---|---|---|
| committer | Steve Block <steveblock@google.com> | 2010-02-18 12:17:02 +0000 |
| commit | 930792dfdde9ad0fac3251ab70eb00d97f2fe88d (patch) | |
| tree | 034286e22e38d273d2bba3dad8983fdea9a2f77f /WebKit/android/jni | |
| parent | 2e837c8b6511f85209518f832e340662218eb3dc (diff) | |
| download | external_webkit-930792dfdde9ad0fac3251ab70eb00d97f2fe88d.zip external_webkit-930792dfdde9ad0fac3251ab70eb00d97f2fe88d.tar.gz external_webkit-930792dfdde9ad0fac3251ab70eb00d97f2fe88d.tar.bz2 | |
Fixes a bug with the Geolocation suspend/resume behaviour
PlatformBridge::isWebViewPaused needs to be an instance method, rather than a
static. This fixes a bug where if the user switches browser windows while a
page that uses Geolocation is still loading, the Geolocation service won't be
started in the suspended state.
Note that this is a temporary fix, as the upstreaming of the existing
suspend/resume code will introduce a new approach, which will avoid this problem
altogether. See https://android-git.corp.google.com/g/#change,38942
Change-Id: I3f07f8837b8a8c1c5e7e4f5112ab487188670c3a
Diffstat (limited to 'WebKit/android/jni')
| -rw-r--r-- | WebKit/android/jni/WebViewCore.cpp | 7 | ||||
| -rw-r--r-- | WebKit/android/jni/WebViewCore.h | 6 |
2 files changed, 6 insertions, 7 deletions
diff --git a/WebKit/android/jni/WebViewCore.cpp b/WebKit/android/jni/WebViewCore.cpp index 4385f4d..0c37380 100644 --- a/WebKit/android/jni/WebViewCore.cpp +++ b/WebKit/android/jni/WebViewCore.cpp @@ -150,8 +150,6 @@ FILE* gRenderTreeFile = 0; namespace android { -bool WebViewCore::s_isPaused = false; - static SkTDArray<WebViewCore*> gInstanceList; void WebViewCore::addInstance(WebViewCore* inst) { @@ -273,6 +271,7 @@ WebViewCore::WebViewCore(JNIEnv* env, jobject javaWebViewCore, WebCore::Frame* m #if ENABLE(TOUCH_EVENTS) m_forwardingTouchEvents = false; #endif + m_isPaused = false; LOG_ASSERT(m_mainFrame, "Uh oh, somehow a frameview was made without an initial frame!"); @@ -2965,7 +2964,7 @@ static void Pause(JNIEnv* env, jobject obj) event.data.lifecycle.action = kPause_ANPLifecycleAction; GET_NATIVE_VIEW(env, obj)->sendPluginEvent(event); - WebViewCore::setIsPaused(true); + GET_NATIVE_VIEW(env, obj)->setIsPaused(true); } static void Resume(JNIEnv* env, jobject obj) @@ -2982,7 +2981,7 @@ static void Resume(JNIEnv* env, jobject obj) event.data.lifecycle.action = kResume_ANPLifecycleAction; GET_NATIVE_VIEW(env, obj)->sendPluginEvent(event); - WebViewCore::setIsPaused(false); + GET_NATIVE_VIEW(env, obj)->setIsPaused(false); } static void FreeMemory(JNIEnv* env, jobject obj) diff --git a/WebKit/android/jni/WebViewCore.h b/WebKit/android/jni/WebViewCore.h index 3085a49..fc5ffc7 100644 --- a/WebKit/android/jni/WebViewCore.h +++ b/WebKit/android/jni/WebViewCore.h @@ -462,8 +462,8 @@ namespace android { // field safely from our respective threads static Mutex gButtonMutex; WTF::Vector<Container> m_buttons; - static bool isPaused() { return s_isPaused; } - static void setIsPaused(bool isPaused) { s_isPaused = isPaused; } + bool isPaused() const { return m_isPaused; } + void setIsPaused(bool isPaused) { m_isPaused = isPaused; } // end of shared members // internal functions @@ -520,7 +520,7 @@ namespace android { unsigned m_domtree_version; bool m_check_domtree_version; PageGroup* m_groupForVisitedLinks; - static bool s_isPaused; + bool m_isPaused; SkTDArray<PluginWidgetAndroid*> m_plugins; WebCore::Timer<WebViewCore> m_pluginInvalTimer; |
