Chromium Code Reviews| 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 980 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 991 jobject obj, | 991 jobject obj, |
| 992 jboolean network_up) { | 992 jboolean network_up) { |
| 993 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 993 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 994 render_view_host_ext_->SetJsOnlineProperty(network_up); | 994 render_view_host_ext_->SetJsOnlineProperty(network_up); |
| 995 } | 995 } |
| 996 | 996 |
| 997 void AwContents::TrimMemoryOnRenderThread(JNIEnv* env, | 997 void AwContents::TrimMemoryOnRenderThread(JNIEnv* env, |
| 998 jobject obj, | 998 jobject obj, |
| 999 jint level, | 999 jint level, |
| 1000 jboolean visible) { | 1000 jboolean visible) { |
| 1001 if (hardware_renderer_) { | 1001 BrowserThread::PostTask( |
| 1002 if (hardware_renderer_->TrimMemory(level, visible)) { | 1002 BrowserThread::UI, |
| 1003 content::BrowserThread::PostTask( | 1003 FROM_HERE, |
| 1004 content::BrowserThread::UI, | 1004 base::Bind(&AwContents::TrimMemory, ui_thread_weak_ptr_, level, visible)); |
|
boliu
2014/05/01 00:37:40
You don't need this trip to RT, change AwContents.
hush (inactive)
2014/05/01 19:03:04
I will rebase onto your change here:
https://coder
| |
| 1005 FROM_HERE, | |
| 1006 base::Bind(&AwContents::ForceFakeComposite, ui_thread_weak_ptr_)); | |
| 1007 } | |
| 1008 } | |
| 1009 } | 1005 } |
| 1010 | 1006 |
| 1011 void AwContents::ForceFakeComposite() { | 1007 void AwContents::TrimMemory(const int level, const bool visible) { |
| 1012 browser_view_renderer_.ForceFakeCompositeSW(); | 1008 browser_view_renderer_.TrimMemory(level, visible); |
| 1013 } | 1009 } |
| 1014 | 1010 |
| 1015 void SetShouldDownloadFavicons(JNIEnv* env, jclass jclazz) { | 1011 void SetShouldDownloadFavicons(JNIEnv* env, jclass jclazz) { |
| 1016 g_should_download_favicons = true; | 1012 g_should_download_favicons = true; |
| 1017 } | 1013 } |
| 1018 | 1014 |
| 1019 } // namespace android_webview | 1015 } // namespace android_webview |
| OLD | NEW |