OLD | NEW |
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/message_loop/message_loop_proxy.h" | 8 #include "base/message_loop/message_loop_proxy.h" |
| 9 #include "base/synchronization/lock.h" |
9 #include "content/public/browser/android/synchronous_compositor.h" | 10 #include "content/public/browser/android/synchronous_compositor.h" |
10 #include "ui/gfx/geometry/rect.h" | 11 #include "ui/gfx/geometry/rect.h" |
11 #include "ui/gfx/geometry/vector2d.h" | 12 #include "ui/gfx/geometry/vector2d.h" |
12 | 13 |
13 namespace android_webview { | 14 namespace android_webview { |
14 | 15 |
15 class BrowserViewRendererClient; | 16 class BrowserViewRendererClient; |
16 | 17 |
17 // Set by BrowserViewRenderer and read by HardwareRenderer. | 18 // Set by BrowserViewRenderer and read by HardwareRenderer. |
18 struct DrawGLInput { | 19 struct DrawGLInput { |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 private: | 58 private: |
58 void ClientRequestDrawGLOnUIThread(); | 59 void ClientRequestDrawGLOnUIThread(); |
59 | 60 |
60 scoped_refptr<base::MessageLoopProxy> ui_loop_; | 61 scoped_refptr<base::MessageLoopProxy> ui_loop_; |
61 // TODO(boliu): Remove |client_on_ui_| from shared state. | 62 // TODO(boliu): Remove |client_on_ui_| from shared state. |
62 BrowserViewRendererClient* client_on_ui_; | 63 BrowserViewRendererClient* client_on_ui_; |
63 base::WeakPtrFactory<SharedRendererState> weak_factory_on_ui_thread_; | 64 base::WeakPtrFactory<SharedRendererState> weak_factory_on_ui_thread_; |
64 base::WeakPtr<SharedRendererState> ui_thread_weak_ptr_; | 65 base::WeakPtr<SharedRendererState> ui_thread_weak_ptr_; |
65 | 66 |
66 // Accessed by both UI and RT thread. | 67 // Accessed by both UI and RT thread. |
| 68 mutable base::Lock lock_; |
67 content::SynchronousCompositor* compositor_; | 69 content::SynchronousCompositor* compositor_; |
68 DrawGLInput draw_gl_input_; | 70 DrawGLInput draw_gl_input_; |
69 }; | 71 }; |
70 | 72 |
71 } // namespace android_webview | 73 } // namespace android_webview |
72 | 74 |
73 #endif // ANDROID_WEBVIEW_BROWSER_SHARED_RENDERER_STATE_H_ | 75 #endif // ANDROID_WEBVIEW_BROWSER_SHARED_RENDERER_STATE_H_ |
OLD | NEW |