| 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 15 matching lines...) Expand all Loading... |
| 26 proxy_impl_(thread_proxy), | 26 proxy_impl_(thread_proxy), |
| 27 main_task_runner_(main_task_runner), | 27 main_task_runner_(main_task_runner), |
| 28 impl_task_runner_(impl_task_runner) {} | 28 impl_task_runner_(impl_task_runner) {} |
| 29 | 29 |
| 30 void ThreadedChannel::SetThrottleFrameProductionOnImpl(bool throttle) { | 30 void ThreadedChannel::SetThrottleFrameProductionOnImpl(bool throttle) { |
| 31 ImplThreadTaskRunner()->PostTask( | 31 ImplThreadTaskRunner()->PostTask( |
| 32 FROM_HERE, base::Bind(&ProxyImpl::SetThrottleFrameProductionOnImpl, | 32 FROM_HERE, base::Bind(&ProxyImpl::SetThrottleFrameProductionOnImpl, |
| 33 proxy_impl_->GetImplWeakPtr(), throttle)); | 33 proxy_impl_->GetImplWeakPtr(), throttle)); |
| 34 } | 34 } |
| 35 | 35 |
| 36 void ThreadedChannel::SetLayerTreeHostClientReadyOnImpl() { | |
| 37 ImplThreadTaskRunner()->PostTask( | |
| 38 FROM_HERE, base::Bind(&ProxyImpl::SetLayerTreeHostClientReadyOnImpl, | |
| 39 proxy_impl_->GetImplWeakPtr())); | |
| 40 } | |
| 41 | |
| 42 void ThreadedChannel::DidCompleteSwapBuffers() { | 36 void ThreadedChannel::DidCompleteSwapBuffers() { |
| 43 MainThreadTaskRunner()->PostTask( | 37 MainThreadTaskRunner()->PostTask( |
| 44 FROM_HERE, base::Bind(&ProxyMain::DidCompleteSwapBuffers, | 38 FROM_HERE, base::Bind(&ProxyMain::DidCompleteSwapBuffers, |
| 45 proxy_main_->GetMainWeakPtr())); | 39 proxy_main_->GetMainWeakPtr())); |
| 46 } | 40 } |
| 47 | 41 |
| 48 ThreadedChannel::~ThreadedChannel() { | 42 ThreadedChannel::~ThreadedChannel() { |
| 49 TRACE_EVENT0("cc", "ThreadChannel::~ThreadChannel"); | 43 TRACE_EVENT0("cc", "ThreadChannel::~ThreadChannel"); |
| 50 } | 44 } |
| 51 | 45 |
| 52 base::SingleThreadTaskRunner* ThreadedChannel::MainThreadTaskRunner() const { | 46 base::SingleThreadTaskRunner* ThreadedChannel::MainThreadTaskRunner() const { |
| 53 return main_task_runner_.get(); | 47 return main_task_runner_.get(); |
| 54 } | 48 } |
| 55 | 49 |
| 56 base::SingleThreadTaskRunner* ThreadedChannel::ImplThreadTaskRunner() const { | 50 base::SingleThreadTaskRunner* ThreadedChannel::ImplThreadTaskRunner() const { |
| 57 return impl_task_runner_.get(); | 51 return impl_task_runner_.get(); |
| 58 } | 52 } |
| 59 | 53 |
| 60 } // namespace cc | 54 } // namespace cc |
| OLD | NEW |