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

Unified Diff: android_webview/browser/shared_renderer_state.h

Issue 408803002: aw: Release hardware onTrimMemory(MODERATE) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: auto reset Created 6 years, 5 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/browser_view_renderer.cc ('k') | android_webview/browser/shared_renderer_state.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.h
diff --git a/android_webview/browser/shared_renderer_state.h b/android_webview/browser/shared_renderer_state.h
index 89554ac8e12aea4648a4aac5b2a84a8a74030056..01363f14b6a21f7fe250c31a21ddab5978af8ed3 100644
--- a/android_webview/browser/shared_renderer_state.h
+++ b/android_webview/browser/shared_renderer_state.h
@@ -24,6 +24,7 @@ class GLInProcessContext;
namespace android_webview {
class BrowserViewRendererClient;
+class InsideHardwareReleaseReset;
// Set by BrowserViewRenderer and read by HardwareRenderer.
struct DrawGLInput {
@@ -48,9 +49,7 @@ class SharedRendererState {
void SetDrawGLInput(scoped_ptr<DrawGLInput> input);
scoped_ptr<DrawGLInput> PassDrawGLInput();
- // Set by UI and read by RT.
- void SetHardwareAllowed(bool allowed);
- bool IsHardwareAllowed() const;
+ bool IsInsideHardwareRelease() const;
void SetSharedContext(gpu::GLInProcessContext* context);
gpu::GLInProcessContext* GetSharedContext() const;
@@ -60,7 +59,10 @@ class SharedRendererState {
bool ReturnedResourcesEmpty() const;
private:
+ friend class InsideHardwareReleaseReset;
hush (inactive) 2014/07/21 23:16:14 You don't need friend class here because you have
boliu 2014/07/21 23:17:16 I moved the setter to private?
hush (inactive) 2014/07/21 23:20:07 Ahh.. yes. Thanks! lgtm On 2014/07/21 23:17:16, bo
+
void ClientRequestDrawGLOnUIThread();
+ void SetInsideHardwareRelease(bool inside);
scoped_refptr<base::MessageLoopProxy> ui_loop_;
BrowserViewRendererClient* client_on_ui_;
@@ -70,9 +72,23 @@ class SharedRendererState {
// Accessed by both UI and RT thread.
mutable base::Lock lock_;
scoped_ptr<DrawGLInput> draw_gl_input_;
- bool hardware_allowed_;
+ bool inside_hardware_release_;
gpu::GLInProcessContext* share_context_;
cc::ReturnedResourceArray returned_resources_;
+
+ DISALLOW_COPY_AND_ASSIGN(SharedRendererState);
+};
+
+class InsideHardwareReleaseReset {
+ public:
+ explicit InsideHardwareReleaseReset(
+ SharedRendererState* shared_renderer_state);
+ ~InsideHardwareReleaseReset();
+
+ private:
+ SharedRendererState* shared_renderer_state_;
+
+ DISALLOW_COPY_AND_ASSIGN(InsideHardwareReleaseReset);
};
} // namespace android_webview
« no previous file with comments | « android_webview/browser/browser_view_renderer.cc ('k') | android_webview/browser/shared_renderer_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698