summaryrefslogtreecommitdiffstats
path: root/Source/WebKit/android/jni/WebViewCore.cpp
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2012-05-21 13:29:29 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2012-05-21 13:29:29 -0700
commit655f75feeee4c396740a8e768888c7c8f0602cb8 (patch)
treec41052dc6a5bb672e40fca362d3f47c3adcaf677 /Source/WebKit/android/jni/WebViewCore.cpp
parent0e518116e66e544a899674ed1a5039b2c7e04f05 (diff)
parent2c52cc3176d97bc3f0bb59f8684c06c94201ef98 (diff)
downloadexternal_webkit-655f75feeee4c396740a8e768888c7c8f0602cb8.zip
external_webkit-655f75feeee4c396740a8e768888c7c8f0602cb8.tar.gz
external_webkit-655f75feeee4c396740a8e768888c7c8f0602cb8.tar.bz2
am 2c52cc31: Merge "Switch to a 4ms/1s timer" into jb-dev
* commit '2c52cc3176d97bc3f0bb59f8684c06c94201ef98': Switch to a 4ms/1s timer
Diffstat (limited to 'Source/WebKit/android/jni/WebViewCore.cpp')
-rw-r--r--Source/WebKit/android/jni/WebViewCore.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/Source/WebKit/android/jni/WebViewCore.cpp b/Source/WebKit/android/jni/WebViewCore.cpp
index 4e45175..d07b00e 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()
@@ -4790,6 +4795,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();
@@ -4810,6 +4817,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();