OLD | NEW |
---|---|
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 1033 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1044 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 1044 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
1045 render_view_host_ext_->SetJsOnlineProperty(network_up); | 1045 render_view_host_ext_->SetJsOnlineProperty(network_up); |
1046 } | 1046 } |
1047 | 1047 |
1048 void AwContents::TrimMemoryOnRenderThread(JNIEnv* env, | 1048 void AwContents::TrimMemoryOnRenderThread(JNIEnv* env, |
1049 jobject obj, | 1049 jobject obj, |
1050 jint level, | 1050 jint level, |
1051 jboolean visible) { | 1051 jboolean visible) { |
1052 if (hardware_renderer_) { | 1052 if (hardware_renderer_) { |
1053 if (hardware_renderer_->TrimMemory(level, visible)) { | 1053 if (hardware_renderer_->TrimMemory(level, visible)) { |
1054 content::BrowserThread::PostTask( | 1054 BrowserThread::PostTask( |
1055 content::BrowserThread::UI, | 1055 BrowserThread::UI, |
1056 FROM_HERE, | 1056 FROM_HERE, |
1057 base::Bind(&AwContents::ForceFakeComposite, ui_thread_weak_ptr_)); | 1057 base::Bind(&AwContents::TrimMemory, ui_thread_weak_ptr_)); |
1058 } | 1058 } |
1059 } | 1059 } |
1060 } | 1060 } |
1061 | 1061 |
1062 void AwContents::ForceFakeComposite() { | 1062 void AwContents::TrimMemory() { |
1063 browser_view_renderer_.ForceFakeCompositeSW(); | 1063 browser_view_renderer_.TrimMemory(); |
boliu
2014/04/28 22:22:15
This might be out of scope for this patch, but can
hush (inactive)
2014/04/30 20:50:17
I put trim memory into BVR.
Haven't thought about
| |
1064 } | 1064 } |
1065 | 1065 |
1066 void SetShouldDownloadFavicons(JNIEnv* env, jclass jclazz) { | 1066 void SetShouldDownloadFavicons(JNIEnv* env, jclass jclazz) { |
1067 g_should_download_favicons = true; | 1067 g_should_download_favicons = true; |
1068 } | 1068 } |
1069 | 1069 |
1070 } // namespace android_webview | 1070 } // namespace android_webview |
OLD | NEW |