| 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" |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 TRACE_EVENT0("cc", "ProxyMain::Stop"); | 405 TRACE_EVENT0("cc", "ProxyMain::Stop"); |
| 406 DCHECK(IsMainThread()); | 406 DCHECK(IsMainThread()); |
| 407 DCHECK(started_); | 407 DCHECK(started_); |
| 408 | 408 |
| 409 channel_main_->SynchronouslyCloseImpl(); | 409 channel_main_->SynchronouslyCloseImpl(); |
| 410 | 410 |
| 411 layer_tree_host_ = nullptr; | 411 layer_tree_host_ = nullptr; |
| 412 started_ = false; | 412 started_ = false; |
| 413 } | 413 } |
| 414 | 414 |
| 415 void ProxyMain::SetMutator(std::unique_ptr<LayerTreeMutator> mutator) { |
| 416 TRACE_EVENT0("compositor-worker", "ThreadProxy::SetMutator"); |
| 417 channel_main_->InitializeMutatorOnImpl(std::move(mutator)); |
| 418 } |
| 419 |
| 415 bool ProxyMain::SupportsImplScrolling() const { | 420 bool ProxyMain::SupportsImplScrolling() const { |
| 416 return true; | 421 return true; |
| 417 } | 422 } |
| 418 | 423 |
| 419 bool ProxyMain::MainFrameWillHappenForTesting() { | 424 bool ProxyMain::MainFrameWillHappenForTesting() { |
| 420 DCHECK(IsMainThread()); | 425 DCHECK(IsMainThread()); |
| 421 bool main_frame_will_happen = false; | 426 bool main_frame_will_happen = false; |
| 422 { | 427 { |
| 423 DebugScopedSetMainThreadBlocked main_thread_blocked(task_runner_provider_); | 428 DebugScopedSetMainThreadBlocked main_thread_blocked(task_runner_provider_); |
| 424 CompletionEvent completion; | 429 CompletionEvent completion; |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 469 return false; | 474 return false; |
| 470 channel_main_->SetNeedsCommitOnImpl(); | 475 channel_main_->SetNeedsCommitOnImpl(); |
| 471 return true; | 476 return true; |
| 472 } | 477 } |
| 473 | 478 |
| 474 bool ProxyMain::IsMainThread() const { | 479 bool ProxyMain::IsMainThread() const { |
| 475 return task_runner_provider_->IsMainThread(); | 480 return task_runner_provider_->IsMainThread(); |
| 476 } | 481 } |
| 477 | 482 |
| 478 } // namespace cc | 483 } // namespace cc |
| OLD | NEW |