Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(707)

Side by Side Diff: android_webview/native/aw_contents.cc

Issue 226363004: Global GPU memory manager for android webview (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Type casts and private methods in BVR. Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « android_webview/native/aw_contents.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "android_webview/native/aw_contents.h" 5 #include "android_webview/native/aw_contents.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "android_webview/browser/aw_browser_context.h" 9 #include "android_webview/browser/aw_browser_context.h"
10 #include "android_webview/browser/aw_browser_main_parts.h" 10 #include "android_webview/browser/aw_browser_main_parts.h"
(...skipping 1040 matching lines...) Expand 10 before | Expand all | Expand 10 after
1051 jobject obj, 1051 jobject obj,
1052 jboolean network_up) { 1052 jboolean network_up) {
1053 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 1053 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
1054 render_view_host_ext_->SetJsOnlineProperty(network_up); 1054 render_view_host_ext_->SetJsOnlineProperty(network_up);
1055 } 1055 }
1056 1056
1057 void AwContents::TrimMemory(JNIEnv* env, 1057 void AwContents::TrimMemory(JNIEnv* env,
1058 jobject obj, 1058 jobject obj,
1059 jint level, 1059 jint level,
1060 jboolean visible) { 1060 jboolean visible) {
1061 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
1062
1061 if (!shared_renderer_state_.IsHardwareInitialized()) 1063 if (!shared_renderer_state_.IsHardwareInitialized())
1062 return; 1064 return;
1063 1065
1064 shared_renderer_state_.AppendClosure( 1066 browser_view_renderer_.TrimMemory(level, visible);
1065 base::Bind(&AwContents::TrimMemoryOnRenderThread,
1066 base::Unretained(this),
1067 level,
1068 visible));
1069 RequestDrawGL(NULL, true);
1070 }
1071
1072 void AwContents::TrimMemoryOnRenderThread(int level, bool visible) {
1073 if (hardware_renderer_ && hardware_renderer_->TrimMemory(level, visible)) {
1074 content::BrowserThread::PostTask(
1075 content::BrowserThread::UI,
1076 FROM_HERE,
1077 base::Bind(&AwContents::ForceFakeComposite, ui_thread_weak_ptr_));
1078 }
1079 }
1080
1081 void AwContents::ForceFakeComposite() {
1082 browser_view_renderer_.ForceFakeCompositeSW();
1083 } 1067 }
1084 1068
1085 void SetShouldDownloadFavicons(JNIEnv* env, jclass jclazz) { 1069 void SetShouldDownloadFavicons(JNIEnv* env, jclass jclazz) {
1086 g_should_download_favicons = true; 1070 g_should_download_favicons = true;
1087 } 1071 }
1088 1072
1089 } // namespace android_webview 1073 } // namespace android_webview
OLDNEW
« no previous file with comments | « android_webview/native/aw_contents.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698