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

Unified 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, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « android_webview/native/aw_contents.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/native/aw_contents.cc
diff --git a/android_webview/native/aw_contents.cc b/android_webview/native/aw_contents.cc
index 15296933e6a039374d424f67bbd957fef22c1d4d..262c204dee152d1ed85762410a26ae6388ef65c3 100644
--- a/android_webview/native/aw_contents.cc
+++ b/android_webview/native/aw_contents.cc
@@ -1058,28 +1058,12 @@ void AwContents::TrimMemory(JNIEnv* env,
jobject obj,
jint level,
jboolean visible) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+
if (!shared_renderer_state_.IsHardwareInitialized())
return;
- shared_renderer_state_.AppendClosure(
- base::Bind(&AwContents::TrimMemoryOnRenderThread,
- base::Unretained(this),
- level,
- visible));
- RequestDrawGL(NULL, true);
-}
-
-void AwContents::TrimMemoryOnRenderThread(int level, bool visible) {
- if (hardware_renderer_ && hardware_renderer_->TrimMemory(level, visible)) {
- content::BrowserThread::PostTask(
- content::BrowserThread::UI,
- FROM_HERE,
- base::Bind(&AwContents::ForceFakeComposite, ui_thread_weak_ptr_));
- }
-}
-
-void AwContents::ForceFakeComposite() {
- browser_view_renderer_.ForceFakeCompositeSW();
+ browser_view_renderer_.TrimMemory(level, visible);
}
void SetShouldDownloadFavicons(JNIEnv* env, jclass jclazz) {
« 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