summaryrefslogtreecommitdiffstats
path: root/android_webview/native
diff options
context:
space:
mode:
authorhush <hush@chromium.org>2015-02-25 14:11:10 -0800
committerCommit bot <commit-bot@chromium.org>2015-02-25 22:11:48 +0000
commitd00f10451d36d173b4d900c9cf3b1d0ff639350e (patch)
tree61ddf8cc33b776f1d398f59db2460688ee4ef5e9 /android_webview/native
parent7995ec80910f1b5fcf6c1a02ecd070bed81cbd8e (diff)
downloadchromium_src-d00f10451d36d173b4d900c9cf3b1d0ff639350e.zip
chromium_src-d00f10451d36d173b4d900c9cf3b1d0ff639350e.tar.gz
chromium_src-d00f10451d36d173b4d900c9cf3b1d0ff639350e.tar.bz2
OffscreenPreRaster and its plumbings
If OffscreenPreRaster is enabled, the viewport rect for tile priority and the tile memory limit calculation will be based on the size of the webview, instead of the size of visible area of the webview. Design doc here https://docs.google.com/document/d/1xOMjvbEIS3dMzpWXWrsl7qV8QOgGEIZL1QxgnfOXmq4/ BUG=460638 Review URL: https://codereview.chromium.org/944053004 Cr-Commit-Position: refs/heads/master@{#318126}
Diffstat (limited to 'android_webview/native')
-rw-r--r--android_webview/native/aw_contents.cc5
-rw-r--r--android_webview/native/aw_contents.h2
-rw-r--r--android_webview/native/aw_settings.cc9
-rw-r--r--android_webview/native/aw_settings.h1
4 files changed, 17 insertions, 0 deletions
diff --git a/android_webview/native/aw_contents.cc b/android_webview/native/aw_contents.cc
index c3c3110..0b034ed 100644
--- a/android_webview/native/aw_contents.cc
+++ b/android_webview/native/aw_contents.cc
@@ -400,6 +400,11 @@ bool AwContents::OnReceivedHttpAuthRequest(const JavaRef<jobject>& handler,
return true;
}
+void AwContents::SetOffscreenPreRaster(bool enabled) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ browser_view_renderer_.SetOffscreenPreRaster(enabled);
+}
+
void AwContents::AddVisitedLinks(JNIEnv* env,
jobject obj,
jobjectArray jvisited_links) {
diff --git a/android_webview/native/aw_contents.h b/android_webview/native/aw_contents.h
index ce3c911..edb60ef 100644
--- a/android_webview/native/aw_contents.h
+++ b/android_webview/native/aw_contents.h
@@ -81,6 +81,8 @@ class AwContents : public FindHelper::Listener,
const std::string& host,
const std::string& realm);
+ void SetOffscreenPreRaster(bool enabled);
+
// Methods called from Java.
void SetJavaPeers(JNIEnv* env,
jobject obj,
diff --git a/android_webview/native/aw_settings.cc b/android_webview/native/aw_settings.cc
index 6589e96..91c5064 100644
--- a/android_webview/native/aw_settings.cc
+++ b/android_webview/native/aw_settings.cc
@@ -131,6 +131,7 @@ void AwSettings::UpdateEverythingLocked(JNIEnv* env, jobject obj) {
ResetScrollAndScaleState(env, obj);
UpdateFormDataPreferencesLocked(env, obj);
UpdateRendererPreferencesLocked(env, obj);
+ UpdateOffscreenPreRasterLocked(env, obj);
}
void AwSettings::UpdateUserAgentLocked(JNIEnv* env, jobject obj) {
@@ -209,6 +210,14 @@ void AwSettings::UpdateRendererPreferencesLocked(JNIEnv* env, jobject obj) {
host->SyncRendererPrefs();
}
+void AwSettings::UpdateOffscreenPreRasterLocked(JNIEnv* env, jobject obj) {
+ AwContents* contents = AwContents::FromWebContents(web_contents());
+ if (contents) {
+ contents->SetOffscreenPreRaster(
+ Java_AwSettings_getOffscreenPreRasterLocked(env, obj));
+ }
+}
+
void AwSettings::RenderViewCreated(content::RenderViewHost* render_view_host) {
// A single WebContents can normally have 0 to many RenderViewHost instances
// associated with it.
diff --git a/android_webview/native/aw_settings.h b/android_webview/native/aw_settings.h
index 581a6cd..56b09ad 100644
--- a/android_webview/native/aw_settings.h
+++ b/android_webview/native/aw_settings.h
@@ -38,6 +38,7 @@ class AwSettings : public content::WebContentsObserver {
void UpdateWebkitPreferencesLocked(JNIEnv* env, jobject obj);
void UpdateFormDataPreferencesLocked(JNIEnv* env, jobject obj);
void UpdateRendererPreferencesLocked(JNIEnv* env, jobject obj);
+ void UpdateOffscreenPreRasterLocked(JNIEnv* env, jobject obj);
void PopulateWebPreferences(content::WebPreferences* web_prefs);