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::SendBeginMainFrameNoLongerRequired() { |
| 699 Proxy::MainThreadTaskRunner()->PostTask( |
| 700 FROM_HERE, base::Bind(&ThreadProxy::BeginMainFrameNoLongerRequired, |
| 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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
846 impl_thread_weak_ptr_, | 852 impl_thread_weak_ptr_, |
847 &completion, | 853 &completion, |
848 queue.release())); | 854 queue.release())); |
849 completion.Wait(); | 855 completion.Wait(); |
850 } | 856 } |
851 | 857 |
852 layer_tree_host()->CommitComplete(); | 858 layer_tree_host()->CommitComplete(); |
853 layer_tree_host()->DidBeginMainFrame(); | 859 layer_tree_host()->DidBeginMainFrame(); |
854 } | 860 } |
855 | 861 |
| 862 void ThreadProxy::BeginMainFrameNoLongerRequired() { |
| 863 TRACE_EVENT0("cc", "ThreadProxy::BeginMainFrameNoLongerRequired"); |
| 864 layer_tree_host()->BeginMainFrameNoLongerRequired(); |
| 865 } |
| 866 |
856 void ThreadProxy::StartCommitOnImplThread(CompletionEvent* completion, | 867 void ThreadProxy::StartCommitOnImplThread(CompletionEvent* completion, |
857 ResourceUpdateQueue* raw_queue) { | 868 ResourceUpdateQueue* raw_queue) { |
858 TRACE_EVENT0("cc", "ThreadProxy::StartCommitOnImplThread"); | 869 TRACE_EVENT0("cc", "ThreadProxy::StartCommitOnImplThread"); |
859 DCHECK(!impl().commit_completion_event); | 870 DCHECK(!impl().commit_completion_event); |
860 DCHECK(IsImplThread() && IsMainThreadBlocked()); | 871 DCHECK(IsImplThread() && IsMainThreadBlocked()); |
861 DCHECK(impl().scheduler); | 872 DCHECK(impl().scheduler); |
862 DCHECK(impl().scheduler->CommitPending()); | 873 DCHECK(impl().scheduler->CommitPending()); |
863 | 874 |
864 if (!impl().layer_tree_host_impl) { | 875 if (!impl().layer_tree_host_impl) { |
865 TRACE_EVENT_INSTANT0( | 876 TRACE_EVENT_INSTANT0( |
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1365 } | 1376 } |
1366 | 1377 |
1367 void ThreadProxy::DidCompletePageScaleAnimationOnImplThread() { | 1378 void ThreadProxy::DidCompletePageScaleAnimationOnImplThread() { |
1368 DCHECK(IsImplThread()); | 1379 DCHECK(IsImplThread()); |
1369 Proxy::MainThreadTaskRunner()->PostTask( | 1380 Proxy::MainThreadTaskRunner()->PostTask( |
1370 FROM_HERE, base::Bind(&ThreadProxy::DidCompletePageScaleAnimation, | 1381 FROM_HERE, base::Bind(&ThreadProxy::DidCompletePageScaleAnimation, |
1371 main_thread_weak_ptr_)); | 1382 main_thread_weak_ptr_)); |
1372 } | 1383 } |
1373 | 1384 |
1374 } // namespace cc | 1385 } // namespace cc |
OLD | NEW |