OLD | NEW |
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 #include "cc/trees/threaded_channel.h" | 5 #include "cc/trees/threaded_channel.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/single_thread_task_runner.h" | 8 #include "base/single_thread_task_runner.h" |
9 #include "base/trace_event/trace_event.h" | 9 #include "base/trace_event/trace_event.h" |
10 | 10 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 FROM_HERE, base::Bind(&ProxyImpl::FinishAllRenderingOnImpl, | 73 FROM_HERE, base::Bind(&ProxyImpl::FinishAllRenderingOnImpl, |
74 proxy_impl_->GetImplWeakPtr(), completion)); | 74 proxy_impl_->GetImplWeakPtr(), completion)); |
75 } | 75 } |
76 | 76 |
77 void ThreadedChannel::SetNeedsCommitOnImpl() { | 77 void ThreadedChannel::SetNeedsCommitOnImpl() { |
78 ImplThreadTaskRunner()->PostTask(FROM_HERE, | 78 ImplThreadTaskRunner()->PostTask(FROM_HERE, |
79 base::Bind(&ProxyImpl::SetNeedsCommitOnImpl, | 79 base::Bind(&ProxyImpl::SetNeedsCommitOnImpl, |
80 proxy_impl_->GetImplWeakPtr())); | 80 proxy_impl_->GetImplWeakPtr())); |
81 } | 81 } |
82 | 82 |
83 void ThreadedChannel::BeginMainFrameAbortedOnImpl(CommitEarlyOutReason reason) { | 83 void ThreadedChannel::BeginMainFrameAbortedOnImpl( |
| 84 CommitEarlyOutReason reason, |
| 85 base::TimeTicks main_thread_start_time) { |
84 ImplThreadTaskRunner()->PostTask( | 86 ImplThreadTaskRunner()->PostTask( |
85 FROM_HERE, base::Bind(&ProxyImpl::BeginMainFrameAbortedOnImpl, | 87 FROM_HERE, base::Bind(&ProxyImpl::BeginMainFrameAbortedOnImpl, |
86 proxy_impl_->GetImplWeakPtr(), reason)); | 88 proxy_impl_->GetImplWeakPtr(), reason, |
| 89 main_thread_start_time)); |
87 } | 90 } |
88 | 91 |
89 void ThreadedChannel::SetNeedsRedrawOnImpl(const gfx::Rect& damage_rect) { | 92 void ThreadedChannel::SetNeedsRedrawOnImpl(const gfx::Rect& damage_rect) { |
90 ImplThreadTaskRunner()->PostTask( | 93 ImplThreadTaskRunner()->PostTask( |
91 FROM_HERE, base::Bind(&ProxyImpl::SetNeedsRedrawOnImpl, | 94 FROM_HERE, base::Bind(&ProxyImpl::SetNeedsRedrawOnImpl, |
92 proxy_impl_->GetImplWeakPtr(), damage_rect)); | 95 proxy_impl_->GetImplWeakPtr(), damage_rect)); |
93 } | 96 } |
94 | 97 |
95 void ThreadedChannel::StartCommitOnImpl(CompletionEvent* completion, | 98 void ThreadedChannel::StartCommitOnImpl(CompletionEvent* completion, |
96 LayerTreeHost* layer_tree_host, | 99 LayerTreeHost* layer_tree_host, |
| 100 base::TimeTicks main_thread_start_time, |
97 bool hold_commit_for_activation) { | 101 bool hold_commit_for_activation) { |
98 ImplThreadTaskRunner()->PostTask( | 102 ImplThreadTaskRunner()->PostTask( |
99 FROM_HERE, | 103 FROM_HERE, |
100 base::Bind(&ProxyImpl::StartCommitOnImpl, proxy_impl_->GetImplWeakPtr(), | 104 base::Bind(&ProxyImpl::StartCommitOnImpl, proxy_impl_->GetImplWeakPtr(), |
101 completion, layer_tree_host, hold_commit_for_activation)); | 105 completion, layer_tree_host, main_thread_start_time, |
| 106 hold_commit_for_activation)); |
102 } | 107 } |
103 | 108 |
104 void ThreadedChannel::InitializeImplOnImpl(CompletionEvent* completion, | 109 void ThreadedChannel::InitializeImplOnImpl(CompletionEvent* completion, |
105 LayerTreeHost* layer_tree_host) { | 110 LayerTreeHost* layer_tree_host) { |
106 ImplThreadTaskRunner()->PostTask( | 111 ImplThreadTaskRunner()->PostTask( |
107 FROM_HERE, | 112 FROM_HERE, |
108 base::Bind(&ProxyImpl::InitializeImplOnImpl, | 113 base::Bind(&ProxyImpl::InitializeImplOnImpl, |
109 base::Unretained(proxy_impl_), completion, layer_tree_host)); | 114 base::Unretained(proxy_impl_), completion, layer_tree_host)); |
110 } | 115 } |
111 | 116 |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 | 232 |
228 base::SingleThreadTaskRunner* ThreadedChannel::MainThreadTaskRunner() const { | 233 base::SingleThreadTaskRunner* ThreadedChannel::MainThreadTaskRunner() const { |
229 return main_task_runner_.get(); | 234 return main_task_runner_.get(); |
230 } | 235 } |
231 | 236 |
232 base::SingleThreadTaskRunner* ThreadedChannel::ImplThreadTaskRunner() const { | 237 base::SingleThreadTaskRunner* ThreadedChannel::ImplThreadTaskRunner() const { |
233 return impl_task_runner_.get(); | 238 return impl_task_runner_.get(); |
234 } | 239 } |
235 | 240 |
236 } // namespace cc | 241 } // namespace cc |
OLD | NEW |