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