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

Side by Side 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: refactor and use MODERATE 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef ANDROID_WEBVIEW_BROWSER_SHARED_RENDERER_STATE_H_ 5 #ifndef ANDROID_WEBVIEW_BROWSER_SHARED_RENDERER_STATE_H_
6 #define ANDROID_WEBVIEW_BROWSER_SHARED_RENDERER_STATE_H_ 6 #define ANDROID_WEBVIEW_BROWSER_SHARED_RENDERER_STATE_H_
7 7
8 #include "base/memory/weak_ptr.h" 8 #include "base/memory/weak_ptr.h"
9 #include "base/message_loop/message_loop_proxy.h" 9 #include "base/message_loop/message_loop_proxy.h"
10 #include "base/synchronization/lock.h" 10 #include "base/synchronization/lock.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 SharedRendererState(scoped_refptr<base::MessageLoopProxy> ui_loop, 42 SharedRendererState(scoped_refptr<base::MessageLoopProxy> ui_loop,
43 BrowserViewRendererClient* client); 43 BrowserViewRendererClient* client);
44 ~SharedRendererState(); 44 ~SharedRendererState();
45 45
46 void ClientRequestDrawGL(); 46 void ClientRequestDrawGL();
47 47
48 void SetDrawGLInput(scoped_ptr<DrawGLInput> input); 48 void SetDrawGLInput(scoped_ptr<DrawGLInput> input);
49 scoped_ptr<DrawGLInput> PassDrawGLInput(); 49 scoped_ptr<DrawGLInput> PassDrawGLInput();
50 50
51 // Set by UI and read by RT. 51 // Set by UI and read by RT.
52 void SetHardwareAllowed(bool allowed); 52 void SetInsideHardwareRelease(bool inside);
53 bool IsHardwareAllowed() const; 53 bool IsInsideHardwareRelease() const;
54 54
55 void SetSharedContext(gpu::GLInProcessContext* context); 55 void SetSharedContext(gpu::GLInProcessContext* context);
56 gpu::GLInProcessContext* GetSharedContext() const; 56 gpu::GLInProcessContext* GetSharedContext() const;
57 57
58 void InsertReturnedResources(const cc::ReturnedResourceArray& resources); 58 void InsertReturnedResources(const cc::ReturnedResourceArray& resources);
59 void SwapReturnedResources(cc::ReturnedResourceArray* resources); 59 void SwapReturnedResources(cc::ReturnedResourceArray* resources);
60 bool ReturnedResourcesEmpty() const; 60 bool ReturnedResourcesEmpty() const;
61 61
62 private: 62 private:
63 void ClientRequestDrawGLOnUIThread(); 63 void ClientRequestDrawGLOnUIThread();
64 64
65 scoped_refptr<base::MessageLoopProxy> ui_loop_; 65 scoped_refptr<base::MessageLoopProxy> ui_loop_;
66 BrowserViewRendererClient* client_on_ui_; 66 BrowserViewRendererClient* client_on_ui_;
67 base::WeakPtrFactory<SharedRendererState> weak_factory_on_ui_thread_; 67 base::WeakPtrFactory<SharedRendererState> weak_factory_on_ui_thread_;
68 base::WeakPtr<SharedRendererState> ui_thread_weak_ptr_; 68 base::WeakPtr<SharedRendererState> ui_thread_weak_ptr_;
69 69
70 // Accessed by both UI and RT thread. 70 // Accessed by both UI and RT thread.
71 mutable base::Lock lock_; 71 mutable base::Lock lock_;
72 scoped_ptr<DrawGLInput> draw_gl_input_; 72 scoped_ptr<DrawGLInput> draw_gl_input_;
73 bool hardware_allowed_; 73 bool inside_hardware_release_;
74 gpu::GLInProcessContext* share_context_; 74 gpu::GLInProcessContext* share_context_;
75 cc::ReturnedResourceArray returned_resources_; 75 cc::ReturnedResourceArray returned_resources_;
76 }; 76 };
77 77
78 } // namespace android_webview 78 } // namespace android_webview
79 79
80 #endif // ANDROID_WEBVIEW_BROWSER_SHARED_RENDERER_STATE_H_ 80 #endif // ANDROID_WEBVIEW_BROWSER_SHARED_RENDERER_STATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698