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 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 TRACE_EVENT0("cc", "ProxyMain::Stop"); | 401 TRACE_EVENT0("cc", "ProxyMain::Stop"); |
402 DCHECK(IsMainThread()); | 402 DCHECK(IsMainThread()); |
403 DCHECK(started_); | 403 DCHECK(started_); |
404 | 404 |
405 channel_main_->SynchronouslyCloseImpl(); | 405 channel_main_->SynchronouslyCloseImpl(); |
406 | 406 |
407 layer_tree_host_ = nullptr; | 407 layer_tree_host_ = nullptr; |
408 started_ = false; | 408 started_ = false; |
409 } | 409 } |
410 | 410 |
| 411 void ProxyMain::SetMutator(std::unique_ptr<LayerTreeMutator> mutator) { |
| 412 TRACE_EVENT0("compositor-worker", "ThreadProxy::SetMutator"); |
| 413 channel_main_->InitializeMutatorOnImpl(std::move(mutator)); |
| 414 } |
| 415 |
411 bool ProxyMain::SupportsImplScrolling() const { | 416 bool ProxyMain::SupportsImplScrolling() const { |
412 return true; | 417 return true; |
413 } | 418 } |
414 | 419 |
415 bool ProxyMain::MainFrameWillHappenForTesting() { | 420 bool ProxyMain::MainFrameWillHappenForTesting() { |
416 DCHECK(IsMainThread()); | 421 DCHECK(IsMainThread()); |
417 bool main_frame_will_happen = false; | 422 bool main_frame_will_happen = false; |
418 { | 423 { |
419 DebugScopedSetMainThreadBlocked main_thread_blocked(task_runner_provider_); | 424 DebugScopedSetMainThreadBlocked main_thread_blocked(task_runner_provider_); |
420 CompletionEvent completion; | 425 CompletionEvent completion; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 return false; | 458 return false; |
454 channel_main_->SetNeedsCommitOnImpl(); | 459 channel_main_->SetNeedsCommitOnImpl(); |
455 return true; | 460 return true; |
456 } | 461 } |
457 | 462 |
458 bool ProxyMain::IsMainThread() const { | 463 bool ProxyMain::IsMainThread() const { |
459 return task_runner_provider_->IsMainThread(); | 464 return task_runner_provider_->IsMainThread(); |
460 } | 465 } |
461 | 466 |
462 } // namespace cc | 467 } // namespace cc |
OLD | NEW |