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

Unified Diff: android_webview/browser/shared_renderer_state.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/browser/shared_renderer_state.h ('k') | android_webview/lib/main/aw_main_delegate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/browser/shared_renderer_state.cc
diff --git a/android_webview/browser/shared_renderer_state.cc b/android_webview/browser/shared_renderer_state.cc
index ffc91ea64767093c3f448cca631ee1b775e64fa8..a4e38734f0e49f5b80940b3554ed2e9d15025f23 100644
--- a/android_webview/browser/shared_renderer_state.cc
+++ b/android_webview/browser/shared_renderer_state.cc
@@ -21,6 +21,7 @@ SharedRendererState::SharedRendererState(
client_on_ui_(client),
weak_factory_on_ui_thread_(this),
ui_thread_weak_ptr_(weak_factory_on_ui_thread_.GetWeakPtr()),
+ memory_policy_dirty_(false),
hardware_initialized_(false) {
DCHECK(ui_loop_->BelongsToCurrentThread());
DCHECK(client_on_ui_);
@@ -59,6 +60,21 @@ content::SynchronousCompositor* SharedRendererState::GetCompositor() {
return compositor_;
}
+void SharedRendererState::SetMemoryPolicy(
+ const content::SynchronousCompositorMemoryPolicy new_policy) {
+ base::AutoLock lock(lock_);
+ if (memory_policy_ != new_policy) {
+ memory_policy_ = new_policy;
+ memory_policy_dirty_ = true;
+ }
+}
+
+content::SynchronousCompositorMemoryPolicy
+SharedRendererState::GetMemoryPolicy() const {
+ base::AutoLock lock(lock_);
+ return memory_policy_;
+}
+
void SharedRendererState::SetDrawGLInput(const DrawGLInput& input) {
base::AutoLock lock(lock_);
draw_gl_input_ = input;
@@ -102,4 +118,14 @@ bool SharedRendererState::IsHardwareInitialized() const {
return hardware_initialized_;
}
+void SharedRendererState::SetMemoryPolicyDirty(bool is_dirty) {
+ base::AutoLock lock(lock_);
+ memory_policy_dirty_ = is_dirty;
+}
+
+bool SharedRendererState::IsMemoryPolicyDirty() const {
+ base::AutoLock lock(lock_);
+ return memory_policy_dirty_;
+}
+
} // namespace android_webview
« no previous file with comments | « android_webview/browser/shared_renderer_state.h ('k') | android_webview/lib/main/aw_main_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698