summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/WebCore/platform/android/SharedTimerAndroid.cpp2
-rw-r--r--Source/WebKit/android/jni/JavaBridge.cpp3
-rw-r--r--Source/WebKit/android/jni/WebViewCore.cpp9
-rw-r--r--Source/WebKit/android/nav/WebView.cpp4
4 files changed, 12 insertions, 6 deletions
diff --git a/Source/WebCore/platform/android/SharedTimerAndroid.cpp b/Source/WebCore/platform/android/SharedTimerAndroid.cpp
index a3f3db5..92223d5 100644
--- a/Source/WebCore/platform/android/SharedTimerAndroid.cpp
+++ b/Source/WebCore/platform/android/SharedTimerAndroid.cpp
@@ -51,7 +51,7 @@ void setSharedTimerFireTime(double fireTime)
{
long long timeInMs = static_cast<long long>((fireTime - WTF::currentTime()) * 1000);
- ALOGV("setSharedTimerFireTime: in %ld millisec", timeInMs);
+ ALOGV("setSharedTimerFireTime: in %d millisec", (int)timeInMs);
if (JavaSharedClient::GetTimerClient())
JavaSharedClient::GetTimerClient()->setSharedTimer(timeInMs);
}
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 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();
diff --git a/Source/WebKit/android/nav/WebView.cpp b/Source/WebKit/android/nav/WebView.cpp
index 473efdb..7485e83 100644
--- a/Source/WebKit/android/nav/WebView.cpp
+++ b/Source/WebKit/android/nav/WebView.cpp
@@ -530,7 +530,7 @@ bool setBaseLayer(BaseLayerAndroid* newBaseLayer, bool showVisualIndicator,
void copyBaseContentToPicture(SkPicture* picture)
{
- if (!m_baseLayer)
+ if (!m_baseLayer || !m_baseLayer->content())
return;
LayerContent* content = m_baseLayer->content();
content->draw(picture->beginRecording(content->width(), content->height(),
@@ -539,7 +539,7 @@ void copyBaseContentToPicture(SkPicture* picture)
}
bool hasContent() {
- if (!m_baseLayer)
+ if (!m_baseLayer || !m_baseLayer->content())
return false;
return !m_baseLayer->content()->isEmpty();
}