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

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

Issue 2000493002: cc: Fix overwriting of commit completion event in MFBA mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: better tests Created 4 years, 7 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
« no previous file with comments | « cc/trees/layer_tree_host_unittest_proxy.cc ('k') | cc/trees/proxy_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_PROXY_IMPL_H_ 5 #ifndef CC_TREES_PROXY_IMPL_H_
6 #define CC_TREES_PROXY_IMPL_H_ 6 #define CC_TREES_PROXY_IMPL_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 30 matching lines...) Expand all
41 virtual void SetDeferCommitsOnImpl(bool defer_commits) const; 41 virtual void SetDeferCommitsOnImpl(bool defer_commits) const;
42 virtual void SetNeedsRedrawOnImpl(const gfx::Rect& damage_rect); 42 virtual void SetNeedsRedrawOnImpl(const gfx::Rect& damage_rect);
43 virtual void SetNeedsCommitOnImpl(); 43 virtual void SetNeedsCommitOnImpl();
44 virtual void BeginMainFrameAbortedOnImpl( 44 virtual void BeginMainFrameAbortedOnImpl(
45 CommitEarlyOutReason reason, 45 CommitEarlyOutReason reason,
46 base::TimeTicks main_thread_start_time); 46 base::TimeTicks main_thread_start_time);
47 virtual void FinishAllRenderingOnImpl(CompletionEvent* completion); 47 virtual void FinishAllRenderingOnImpl(CompletionEvent* completion);
48 virtual void SetVisibleOnImpl(bool visible); 48 virtual void SetVisibleOnImpl(bool visible);
49 virtual void ReleaseOutputSurfaceOnImpl(CompletionEvent* completion); 49 virtual void ReleaseOutputSurfaceOnImpl(CompletionEvent* completion);
50 virtual void FinishGLOnImpl(CompletionEvent* completion); 50 virtual void FinishGLOnImpl(CompletionEvent* completion);
51 virtual void MainFrameWillHappenOnImplForTesting(
52 CompletionEvent* completion,
53 bool* main_frame_will_happen);
54 virtual void StartCommitOnImpl(CompletionEvent* completion, 51 virtual void StartCommitOnImpl(CompletionEvent* completion,
55 LayerTreeHost* layer_tree_host, 52 LayerTreeHost* layer_tree_host,
56 base::TimeTicks main_thread_start_time, 53 base::TimeTicks main_thread_start_time,
57 bool hold_commit_for_activation); 54 bool hold_commit_for_activation);
58 55
56 void MainFrameWillHappenOnImplForTesting(CompletionEvent* completion,
57 bool* main_frame_will_happen);
58 void BlockNotifyReadyToActivateForTesting(bool block);
59 CompletionEvent* ActivationCompletionEventForTesting();
60
59 protected: 61 protected:
60 // protected for testing. 62 // protected for testing.
61 ProxyImpl(ChannelImpl* channel_impl, 63 ProxyImpl(ChannelImpl* channel_impl,
62 LayerTreeHost* layer_tree_host, 64 LayerTreeHost* layer_tree_host,
63 TaskRunnerProvider* task_runner_provider, 65 TaskRunnerProvider* task_runner_provider,
64 std::unique_ptr<BeginFrameSource> external_begin_frame_source); 66 std::unique_ptr<BeginFrameSource> external_begin_frame_source);
65 67
66 private: 68 private:
67 // The members of this struct should be accessed on the impl thread only when 69 // The members of this struct should be accessed on the impl thread only when
68 // the main thread is blocked for a commit. 70 // the main thread is blocked for a commit.
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 DrawResult DrawAndSwapInternal(bool forced_draw); 125 DrawResult DrawAndSwapInternal(bool forced_draw);
124 126
125 bool IsImplThread() const; 127 bool IsImplThread() const;
126 bool IsMainThreadBlocked() const; 128 bool IsMainThreadBlocked() const;
127 129
128 const int layer_tree_host_id_; 130 const int layer_tree_host_id_;
129 131
130 std::unique_ptr<Scheduler> scheduler_; 132 std::unique_ptr<Scheduler> scheduler_;
131 133
132 // Set when the main thread is waiting on a pending tree activation. 134 // Set when the main thread is waiting on a pending tree activation.
133 bool next_commit_waits_for_activation_; 135 bool commit_completion_waits_for_activation_;
134 136
135 // Set when the main thread is waiting on a commit to complete or on a 137 // Set when the main thread is waiting on a commit to complete.
136 // pending tree activation.
137 CompletionEvent* commit_completion_event_; 138 CompletionEvent* commit_completion_event_;
138 139
140 // Set when the main thread is waiting for activation to complete.
141 CompletionEvent* activation_completion_event_;
142
139 // Set when the next draw should post DidCommitAndDrawFrame to the main 143 // Set when the next draw should post DidCommitAndDrawFrame to the main
140 // thread. 144 // thread.
141 bool next_frame_is_newly_committed_frame_; 145 bool next_frame_is_newly_committed_frame_;
142 146
143 bool inside_draw_; 147 bool inside_draw_;
144 bool input_throttled_until_commit_; 148 bool input_throttled_until_commit_;
145 149
146 TaskRunnerProvider* task_runner_provider_; 150 TaskRunnerProvider* task_runner_provider_;
147 151
148 DelayedUniqueNotifier smoothness_priority_expiration_notifier_; 152 DelayedUniqueNotifier smoothness_priority_expiration_notifier_;
(...skipping 11 matching lines...) Expand all
160 // Use accessors instead of this variable directly. 164 // Use accessors instead of this variable directly.
161 BlockedMainCommitOnly main_thread_blocked_commit_vars_unsafe_; 165 BlockedMainCommitOnly main_thread_blocked_commit_vars_unsafe_;
162 BlockedMainCommitOnly& blocked_main_commit(); 166 BlockedMainCommitOnly& blocked_main_commit();
163 167
164 DISALLOW_COPY_AND_ASSIGN(ProxyImpl); 168 DISALLOW_COPY_AND_ASSIGN(ProxyImpl);
165 }; 169 };
166 170
167 } // namespace cc 171 } // namespace cc
168 172
169 #endif // CC_TREES_PROXY_IMPL_H_ 173 #endif // CC_TREES_PROXY_IMPL_H_
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_unittest_proxy.cc ('k') | cc/trees/proxy_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698