summaryrefslogtreecommitdiffstats
path: root/Source/WebKit/android
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2012-05-21 14:32:35 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2012-05-21 14:32:35 -0700
commit937f02eed327b38392b69ef4db158dc7a152ed93 (patch)
tree59cd971cf32a40ebc151beef1bfe14ad8593f79c /Source/WebKit/android
parentd79c461a709fb422b8bf694bd665ca144689bfe6 (diff)
parent655f75feeee4c396740a8e768888c7c8f0602cb8 (diff)
downloadexternal_webkit-937f02eed327b38392b69ef4db158dc7a152ed93.zip
external_webkit-937f02eed327b38392b69ef4db158dc7a152ed93.tar.gz
external_webkit-937f02eed327b38392b69ef4db158dc7a152ed93.tar.bz2
am 655f75fe: am 2c52cc31: Merge "Switch to a 4ms/1s timer" into jb-dev
* commit '655f75feeee4c396740a8e768888c7c8f0602cb8': Switch to a 4ms/1s timer
Diffstat (limited to 'Source/WebKit/android')
-rw-r--r--Source/WebKit/android/jni/JavaBridge.cpp3
-rw-r--r--Source/WebKit/android/jni/WebViewCore.cpp9
2 files changed, 9 insertions, 3 deletions
diff --git a/Source/WebKit/android/jni/JavaBridge.cpp b/Source/WebKit/android/jni/JavaBridge.cpp
index 4c8234b..9f89ccd 100644
--- a/Source/WebKit/android/jni/JavaBridge.cpp
+++ b/Source/WebKit/android/jni/JavaBridge.cpp
@@ -370,10 +370,7 @@ void JavaBridge::Finalize(JNIEnv* env, jobject obj)
void JavaBridge::SharedTimerFired(JNIEnv* env, jobject)
{
if (sSharedTimerFiredCallback)
- {
- SkAutoMemoryUsageProbe mup("JavaBridge::sharedTimerFired");
sSharedTimerFiredCallback();
- }
}
void JavaBridge::SetCacheSize(JNIEnv* env, jobject obj, jint bytes)
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();