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

Side by Side Diff: android_webview/browser/render_thread_manager.h

Issue 2560463002: aw: Fix race between first frame draw and view detach causing deadlock. (Closed)
Patch Set: unconditionally set has_received_frame_ to false in DeleteHardwareRendererOnUI Created 4 years 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
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_RENDER_THREAD_MANAGER_H_ 5 #ifndef ANDROID_WEBVIEW_BROWSER_RENDER_THREAD_MANAGER_H_
6 #define ANDROID_WEBVIEW_BROWSER_RENDER_THREAD_MANAGER_H_ 6 #define ANDROID_WEBVIEW_BROWSER_RENDER_THREAD_MANAGER_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "android_webview/browser/compositor_frame_consumer.h" 10 #include "android_webview/browser/compositor_frame_consumer.h"
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 void UpdateParentDrawConstraintsOnUI(); 93 void UpdateParentDrawConstraintsOnUI();
94 bool IsInsideHardwareRelease() const; 94 bool IsInsideHardwareRelease() const;
95 void SetInsideHardwareRelease(bool inside); 95 void SetInsideHardwareRelease(bool inside);
96 96
97 // Accessed by UI thread. 97 // Accessed by UI thread.
98 scoped_refptr<base::SingleThreadTaskRunner> ui_loop_; 98 scoped_refptr<base::SingleThreadTaskRunner> ui_loop_;
99 RenderThreadManagerClient* const client_; 99 RenderThreadManagerClient* const client_;
100 CompositorFrameProducer* compositor_frame_producer_; 100 CompositorFrameProducer* compositor_frame_producer_;
101 base::WeakPtr<RenderThreadManager> ui_thread_weak_ptr_; 101 base::WeakPtr<RenderThreadManager> ui_thread_weak_ptr_;
102 base::CancelableClosure request_draw_gl_cancelable_closure_; 102 base::CancelableClosure request_draw_gl_cancelable_closure_;
103 // Whether any frame has been received on the UI thread by
104 // RenderThreadManager.
105 bool has_received_frame_;
103 106
104 // Accessed by RT thread. 107 // Accessed by RT thread.
105 std::unique_ptr<HardwareRenderer> hardware_renderer_; 108 std::unique_ptr<HardwareRenderer> hardware_renderer_;
106 109
107 // This is accessed by both UI and RT now. TODO(hush): move to RT only. 110 // This is accessed by both UI and RT now. TODO(hush): move to RT only.
108 GLViewRendererManager::Key renderer_manager_key_; 111 GLViewRendererManager::Key renderer_manager_key_;
109 112
110 // Accessed by both UI and RT thread. 113 // Accessed by both UI and RT thread.
111 mutable base::Lock lock_; 114 mutable base::Lock lock_;
112 bool hardware_renderer_has_frame_;
113 gfx::Vector2d scroll_offset_; 115 gfx::Vector2d scroll_offset_;
114 ChildFrameQueue child_frames_; 116 ChildFrameQueue child_frames_;
115 const bool sync_on_draw_hardware_; 117 const bool sync_on_draw_hardware_;
116 bool inside_hardware_release_; 118 bool inside_hardware_release_;
117 ParentCompositorDrawConstraints parent_draw_constraints_; 119 ParentCompositorDrawConstraints parent_draw_constraints_;
118 ReturnedResourcesMap returned_resources_map_; 120 ReturnedResourcesMap returned_resources_map_;
119 base::Closure request_draw_gl_closure_; 121 base::Closure request_draw_gl_closure_;
120 122
121 base::WeakPtrFactory<RenderThreadManager> weak_factory_on_ui_thread_; 123 base::WeakPtrFactory<RenderThreadManager> weak_factory_on_ui_thread_;
122 124
123 DISALLOW_COPY_AND_ASSIGN(RenderThreadManager); 125 DISALLOW_COPY_AND_ASSIGN(RenderThreadManager);
124 }; 126 };
125 127
126 } // namespace android_webview 128 } // namespace android_webview
127 129
128 #endif // ANDROID_WEBVIEW_BROWSER_RENDER_THREAD_MANAGER_H_ 130 #endif // ANDROID_WEBVIEW_BROWSER_RENDER_THREAD_MANAGER_H_
OLDNEW
« no previous file with comments | « android_webview/browser/browser_view_renderer.h ('k') | android_webview/browser/render_thread_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698