diff options
Diffstat (limited to 'Source/WebKit/android/jni/WebViewCore.cpp')
-rw-r--r-- | Source/WebKit/android/jni/WebViewCore.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Source/WebKit/android/jni/WebViewCore.cpp b/Source/WebKit/android/jni/WebViewCore.cpp index 4fab7d4..8499b50 100644 --- a/Source/WebKit/android/jni/WebViewCore.cpp +++ b/Source/WebKit/android/jni/WebViewCore.cpp @@ -171,6 +171,9 @@ FILE* gRenderTreeFile = 0; #include "RenderLayerCompositor.h" #endif +#define FOREGROUND_TIMER_INTERVAL 0.004 // 4ms +#define BACKGROUND_TIMER_INTERVAL 1.0 // 1s + // How many ms to wait for the scroll to "settle" before we will consider doing // prerenders #define PRERENDER_AFTER_SCROLL_DELAY 750 @@ -549,6 +552,8 @@ WebViewCore::WebViewCore(JNIEnv* env, jobject javaWebViewCore, WebCore::Frame* m // HTML5 History API RuntimeEnabledFeatures::setPushStateEnabled(true); + if (m_mainFrame) + m_mainFrame->settings()->setMinDOMTimerInterval(FOREGROUND_TIMER_INTERVAL); } WebViewCore::~WebViewCore() @@ -4788,6 +4793,8 @@ static void Pause(JNIEnv* env, jobject obj, jint nativeClass) if (geolocation) geolocation->suspend(); } + if (mainFrame) + mainFrame->settings()->setMinDOMTimerInterval(BACKGROUND_TIMER_INTERVAL); viewImpl->deviceMotionAndOrientationManager()->maybeSuspendClients(); @@ -4808,6 +4815,8 @@ static void Resume(JNIEnv* env, jobject obj, jint nativeClass) if (geolocation) geolocation->resume(); } + if (mainFrame) + mainFrame->settings()->setMinDOMTimerInterval(FOREGROUND_TIMER_INTERVAL); viewImpl->deviceMotionAndOrientationManager()->maybeResumeClients(); |