| 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/proxy_main.h" | 5 #include "cc/trees/proxy_main.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/trace_event/trace_event.h" | 10 #include "base/trace_event/trace_event.h" |
| 11 #include "base/trace_event/trace_event_argument.h" | 11 #include "base/trace_event/trace_event_argument.h" |
| 12 #include "base/trace_event/trace_event_synthetic_delay.h" | 12 #include "base/trace_event/trace_event_synthetic_delay.h" |
| 13 #include "cc/animation/animation_events.h" | 13 #include "cc/animation/animation_events.h" |
| 14 #include "cc/debug/benchmark_instrumentation.h" | 14 #include "cc/debug/benchmark_instrumentation.h" |
| 15 #include "cc/debug/devtools_instrumentation.h" | 15 #include "cc/debug/devtools_instrumentation.h" |
| 16 #include "cc/output/output_surface.h" | 16 #include "cc/output/output_surface.h" |
| 17 #include "cc/output/swap_promise.h" | 17 #include "cc/output/swap_promise.h" |
| 18 #include "cc/resources/ui_resource_manager.h" | 18 #include "cc/resources/ui_resource_manager.h" |
| 19 #include "cc/trees/blocking_task_runner.h" | 19 #include "cc/trees/blocking_task_runner.h" |
| 20 #include "cc/trees/layer_tree_host.h" | 20 #include "cc/trees/layer_tree_host_in_process.h" |
| 21 #include "cc/trees/remote_channel_main.h" | 21 #include "cc/trees/remote_channel_main.h" |
| 22 #include "cc/trees/scoped_abort_remaining_swap_promises.h" | 22 #include "cc/trees/scoped_abort_remaining_swap_promises.h" |
| 23 #include "cc/trees/threaded_channel.h" | 23 #include "cc/trees/threaded_channel.h" |
| 24 | 24 |
| 25 namespace cc { | 25 namespace cc { |
| 26 | 26 |
| 27 std::unique_ptr<ProxyMain> ProxyMain::CreateThreaded( | 27 std::unique_ptr<ProxyMain> ProxyMain::CreateThreaded( |
| 28 LayerTreeHost* layer_tree_host, | 28 LayerTreeHostInProcess* layer_tree_host, |
| 29 TaskRunnerProvider* task_runner_provider) { | 29 TaskRunnerProvider* task_runner_provider) { |
| 30 std::unique_ptr<ProxyMain> proxy_main( | 30 std::unique_ptr<ProxyMain> proxy_main( |
| 31 new ProxyMain(layer_tree_host, task_runner_provider)); | 31 new ProxyMain(layer_tree_host, task_runner_provider)); |
| 32 proxy_main->SetChannel( | 32 proxy_main->SetChannel( |
| 33 ThreadedChannel::Create(proxy_main.get(), task_runner_provider)); | 33 ThreadedChannel::Create(proxy_main.get(), task_runner_provider)); |
| 34 return proxy_main; | 34 return proxy_main; |
| 35 } | 35 } |
| 36 | 36 |
| 37 std::unique_ptr<ProxyMain> ProxyMain::CreateRemote( | 37 std::unique_ptr<ProxyMain> ProxyMain::CreateRemote( |
| 38 RemoteProtoChannel* remote_proto_channel, | 38 RemoteProtoChannel* remote_proto_channel, |
| 39 LayerTreeHost* layer_tree_host, | 39 LayerTreeHostInProcess* layer_tree_host, |
| 40 TaskRunnerProvider* task_runner_provider) { | 40 TaskRunnerProvider* task_runner_provider) { |
| 41 std::unique_ptr<ProxyMain> proxy_main( | 41 std::unique_ptr<ProxyMain> proxy_main( |
| 42 new ProxyMain(layer_tree_host, task_runner_provider)); | 42 new ProxyMain(layer_tree_host, task_runner_provider)); |
| 43 proxy_main->SetChannel(RemoteChannelMain::Create( | 43 proxy_main->SetChannel(RemoteChannelMain::Create( |
| 44 remote_proto_channel, proxy_main.get(), task_runner_provider)); | 44 remote_proto_channel, proxy_main.get(), task_runner_provider)); |
| 45 return proxy_main; | 45 return proxy_main; |
| 46 } | 46 } |
| 47 | 47 |
| 48 ProxyMain::ProxyMain(LayerTreeHost* layer_tree_host, | 48 ProxyMain::ProxyMain(LayerTreeHostInProcess* layer_tree_host, |
| 49 TaskRunnerProvider* task_runner_provider) | 49 TaskRunnerProvider* task_runner_provider) |
| 50 : layer_tree_host_(layer_tree_host), | 50 : layer_tree_host_(layer_tree_host), |
| 51 task_runner_provider_(task_runner_provider), | 51 task_runner_provider_(task_runner_provider), |
| 52 layer_tree_host_id_(layer_tree_host->GetId()), | 52 layer_tree_host_id_(layer_tree_host->GetId()), |
| 53 max_requested_pipeline_stage_(NO_PIPELINE_STAGE), | 53 max_requested_pipeline_stage_(NO_PIPELINE_STAGE), |
| 54 current_pipeline_stage_(NO_PIPELINE_STAGE), | 54 current_pipeline_stage_(NO_PIPELINE_STAGE), |
| 55 final_pipeline_stage_(NO_PIPELINE_STAGE), | 55 final_pipeline_stage_(NO_PIPELINE_STAGE), |
| 56 commit_waits_for_activation_(false), | 56 commit_waits_for_activation_(false), |
| 57 started_(false), | 57 started_(false), |
| 58 defer_commits_(false) { | 58 defer_commits_(false) { |
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 return false; | 422 return false; |
| 423 channel_main_->SetNeedsCommitOnImpl(); | 423 channel_main_->SetNeedsCommitOnImpl(); |
| 424 return true; | 424 return true; |
| 425 } | 425 } |
| 426 | 426 |
| 427 bool ProxyMain::IsMainThread() const { | 427 bool ProxyMain::IsMainThread() const { |
| 428 return task_runner_provider_->IsMainThread(); | 428 return task_runner_provider_->IsMainThread(); |
| 429 } | 429 } |
| 430 | 430 |
| 431 } // namespace cc | 431 } // namespace cc |
| OLD | NEW |