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

Side by Side Diff: cc/trees/single_thread_proxy.h

Issue 2757373002: Fixing flakiness of TextureLayerChangeInvisibleMailboxTest (Closed)
Patch Set: Rename Created 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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 CC_TREES_SINGLE_THREAD_PROXY_H_ 5 #ifndef CC_TREES_SINGLE_THREAD_PROXY_H_
6 #define CC_TREES_SINGLE_THREAD_PROXY_H_ 6 #define CC_TREES_SINGLE_THREAD_PROXY_H_
7 7
8 #include <limits> 8 #include <limits>
9 9
10 #include "base/cancelable_callback.h" 10 #include "base/cancelable_callback.h"
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 void DoPainting(); 115 void DoPainting();
116 void DoCommit(); 116 void DoCommit();
117 DrawResult DoComposite(LayerTreeHostImpl::FrameData* frame); 117 DrawResult DoComposite(LayerTreeHostImpl::FrameData* frame);
118 void DoSwap(); 118 void DoSwap();
119 void DidCommitAndDrawFrame(); 119 void DidCommitAndDrawFrame();
120 void CommitComplete(); 120 void CommitComplete();
121 121
122 bool ShouldComposite() const; 122 bool ShouldComposite() const;
123 void ScheduleRequestNewCompositorFrameSink(); 123 void ScheduleRequestNewCompositorFrameSink();
124 124
125 void DidReceiveCompositorFrameAck();
126
125 // Accessed on main thread only. 127 // Accessed on main thread only.
126 LayerTreeHost* layer_tree_host_; 128 LayerTreeHost* layer_tree_host_;
127 LayerTreeHostSingleThreadClient* single_thread_client_; 129 LayerTreeHostSingleThreadClient* single_thread_client_;
128 130
129 TaskRunnerProvider* task_runner_provider_; 131 TaskRunnerProvider* task_runner_provider_;
130 132
131 // Used on the Thread, but checked on main thread during 133 // Used on the Thread, but checked on main thread during
132 // initialization/shutdown. 134 // initialization/shutdown.
133 std::unique_ptr<LayerTreeHostImpl> layer_tree_host_impl_; 135 std::unique_ptr<LayerTreeHostImpl> layer_tree_host_impl_;
134 136
(...skipping 16 matching lines...) Expand all
151 // True if a request to the LayerTreeHostClient to create an output surface 153 // True if a request to the LayerTreeHostClient to create an output surface
152 // is still outstanding. 154 // is still outstanding.
153 bool compositor_frame_sink_creation_requested_; 155 bool compositor_frame_sink_creation_requested_;
154 // When output surface is lost, is set to true until a new output surface is 156 // When output surface is lost, is set to true until a new output surface is
155 // initialized. 157 // initialized.
156 bool compositor_frame_sink_lost_; 158 bool compositor_frame_sink_lost_;
157 159
158 // This is the callback for the scheduled RequestNewCompositorFrameSink. 160 // This is the callback for the scheduled RequestNewCompositorFrameSink.
159 base::CancelableClosure compositor_frame_sink_creation_callback_; 161 base::CancelableClosure compositor_frame_sink_creation_callback_;
160 162
163 base::WeakPtr<SingleThreadProxy> frame_sink_bound_weak_ptr_;
164
165 // WeakPtrs generated by this factory will be invalidated when
166 // CompositorFrameSink is released.
167 base::WeakPtrFactory<SingleThreadProxy> frame_sink_bound_weak_factory_;
168
161 base::WeakPtrFactory<SingleThreadProxy> weak_factory_; 169 base::WeakPtrFactory<SingleThreadProxy> weak_factory_;
162 170
163 DISALLOW_COPY_AND_ASSIGN(SingleThreadProxy); 171 DISALLOW_COPY_AND_ASSIGN(SingleThreadProxy);
164 }; 172 };
165 173
166 // For use in the single-threaded case. In debug builds, it pretends that the 174 // For use in the single-threaded case. In debug builds, it pretends that the
167 // code is running on the impl thread to satisfy assertion checks. 175 // code is running on the impl thread to satisfy assertion checks.
168 class DebugScopedSetImplThread { 176 class DebugScopedSetImplThread {
169 public: 177 public:
170 #if DCHECK_IS_ON() 178 #if DCHECK_IS_ON()
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 private: 242 private:
235 DebugScopedSetImplThread impl_thread_; 243 DebugScopedSetImplThread impl_thread_;
236 DebugScopedSetMainThreadBlocked main_thread_blocked_; 244 DebugScopedSetMainThreadBlocked main_thread_blocked_;
237 245
238 DISALLOW_COPY_AND_ASSIGN(DebugScopedSetImplThreadAndMainThreadBlocked); 246 DISALLOW_COPY_AND_ASSIGN(DebugScopedSetImplThreadAndMainThreadBlocked);
239 }; 247 };
240 248
241 } // namespace cc 249 } // namespace cc
242 250
243 #endif // CC_TREES_SINGLE_THREAD_PROXY_H_ 251 #endif // CC_TREES_SINGLE_THREAD_PROXY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698