OLD | NEW |
---|---|
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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/thread_proxy.h" | 5 #include "cc/trees/thread_proxy.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
688 Proxy::MainThreadTaskRunner()->PostTask( | 688 Proxy::MainThreadTaskRunner()->PostTask( |
689 FROM_HERE, | 689 FROM_HERE, |
690 base::Bind(&ThreadProxy::BeginMainFrame, | 690 base::Bind(&ThreadProxy::BeginMainFrame, |
691 main_thread_weak_ptr_, | 691 main_thread_weak_ptr_, |
692 base::Passed(&begin_main_frame_state))); | 692 base::Passed(&begin_main_frame_state))); |
693 devtools_instrumentation::DidRequestMainThreadFrame( | 693 devtools_instrumentation::DidRequestMainThreadFrame( |
694 impl().layer_tree_host_id); | 694 impl().layer_tree_host_id); |
695 impl().timing_history.DidBeginMainFrame(); | 695 impl().timing_history.DidBeginMainFrame(); |
696 } | 696 } |
697 | 697 |
698 void ThreadProxy::SendBeginMainFrameNotExpectedSoon() { | |
699 Proxy::MainThreadTaskRunner()->PostTask( | |
700 FROM_HERE, base::Bind(&ThreadProxy::BeginMainFrameNotExpectedSoon, | |
701 main_thread_weak_ptr_)); | |
702 } | |
703 | |
698 void ThreadProxy::BeginMainFrame( | 704 void ThreadProxy::BeginMainFrame( |
699 scoped_ptr<BeginMainFrameAndCommitState> begin_main_frame_state) { | 705 scoped_ptr<BeginMainFrameAndCommitState> begin_main_frame_state) { |
700 benchmark_instrumentation::ScopedBeginFrameTask begin_frame_task( | 706 benchmark_instrumentation::ScopedBeginFrameTask begin_frame_task( |
701 benchmark_instrumentation::kDoBeginFrame, | 707 benchmark_instrumentation::kDoBeginFrame, |
702 begin_main_frame_state->begin_frame_id); | 708 begin_main_frame_state->begin_frame_id); |
703 TRACE_EVENT_SYNTHETIC_DELAY_BEGIN("cc.BeginMainFrame"); | 709 TRACE_EVENT_SYNTHETIC_DELAY_BEGIN("cc.BeginMainFrame"); |
704 DCHECK(IsMainThread()); | 710 DCHECK(IsMainThread()); |
705 | 711 |
706 if (main().defer_commits) { | 712 if (main().defer_commits) { |
707 TRACE_EVENT_INSTANT0("cc", "EarlyOut_DeferCommit", | 713 TRACE_EVENT_INSTANT0("cc", "EarlyOut_DeferCommit", |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
848 impl_thread_weak_ptr_, | 854 impl_thread_weak_ptr_, |
849 &completion, | 855 &completion, |
850 queue.release())); | 856 queue.release())); |
851 completion.Wait(); | 857 completion.Wait(); |
852 } | 858 } |
853 | 859 |
854 layer_tree_host()->CommitComplete(); | 860 layer_tree_host()->CommitComplete(); |
855 layer_tree_host()->DidBeginMainFrame(); | 861 layer_tree_host()->DidBeginMainFrame(); |
856 } | 862 } |
857 | 863 |
864 void ThreadProxy::BeginMainFrameNotExpectedSoon() { | |
865 TRACE_EVENT0("cc", "ThreadProxy::BeginMainFrameNotExpectedSoon"); | |
Sami
2015/02/11 15:28:25
DCHECK(IsMainThread());
rmcilroy
2015/02/13 16:32:45
Done.
| |
866 layer_tree_host()->BeginMainFrameNotExpectedSoon(); | |
867 } | |
868 | |
858 void ThreadProxy::StartCommitOnImplThread(CompletionEvent* completion, | 869 void ThreadProxy::StartCommitOnImplThread(CompletionEvent* completion, |
859 ResourceUpdateQueue* raw_queue) { | 870 ResourceUpdateQueue* raw_queue) { |
860 TRACE_EVENT0("cc", "ThreadProxy::StartCommitOnImplThread"); | 871 TRACE_EVENT0("cc", "ThreadProxy::StartCommitOnImplThread"); |
861 DCHECK(!impl().commit_completion_event); | 872 DCHECK(!impl().commit_completion_event); |
862 DCHECK(IsImplThread() && IsMainThreadBlocked()); | 873 DCHECK(IsImplThread() && IsMainThreadBlocked()); |
863 DCHECK(impl().scheduler); | 874 DCHECK(impl().scheduler); |
864 DCHECK(impl().scheduler->CommitPending()); | 875 DCHECK(impl().scheduler->CommitPending()); |
865 | 876 |
866 if (!impl().layer_tree_host_impl) { | 877 if (!impl().layer_tree_host_impl) { |
867 TRACE_EVENT_INSTANT0( | 878 TRACE_EVENT_INSTANT0( |
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1368 } | 1379 } |
1369 | 1380 |
1370 void ThreadProxy::DidCompletePageScaleAnimationOnImplThread() { | 1381 void ThreadProxy::DidCompletePageScaleAnimationOnImplThread() { |
1371 DCHECK(IsImplThread()); | 1382 DCHECK(IsImplThread()); |
1372 Proxy::MainThreadTaskRunner()->PostTask( | 1383 Proxy::MainThreadTaskRunner()->PostTask( |
1373 FROM_HERE, base::Bind(&ThreadProxy::DidCompletePageScaleAnimation, | 1384 FROM_HERE, base::Bind(&ThreadProxy::DidCompletePageScaleAnimation, |
1374 main_thread_weak_ptr_)); | 1385 main_thread_weak_ptr_)); |
1375 } | 1386 } |
1376 | 1387 |
1377 } // namespace cc | 1388 } // namespace cc |
OLD | NEW |