| 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"); |
| 866 DCHECK(IsMainThread()); |
| 867 layer_tree_host()->BeginMainFrameNotExpectedSoon(); |
| 868 } |
| 869 |
| 858 void ThreadProxy::StartCommitOnImplThread(CompletionEvent* completion, | 870 void ThreadProxy::StartCommitOnImplThread(CompletionEvent* completion, |
| 859 ResourceUpdateQueue* raw_queue) { | 871 ResourceUpdateQueue* raw_queue) { |
| 860 TRACE_EVENT0("cc", "ThreadProxy::StartCommitOnImplThread"); | 872 TRACE_EVENT0("cc", "ThreadProxy::StartCommitOnImplThread"); |
| 861 DCHECK(!impl().commit_completion_event); | 873 DCHECK(!impl().commit_completion_event); |
| 862 DCHECK(IsImplThread() && IsMainThreadBlocked()); | 874 DCHECK(IsImplThread() && IsMainThreadBlocked()); |
| 863 DCHECK(impl().scheduler); | 875 DCHECK(impl().scheduler); |
| 864 DCHECK(impl().scheduler->CommitPending()); | 876 DCHECK(impl().scheduler->CommitPending()); |
| 865 | 877 |
| 866 if (!impl().layer_tree_host_impl) { | 878 if (!impl().layer_tree_host_impl) { |
| 867 TRACE_EVENT_INSTANT0( | 879 TRACE_EVENT_INSTANT0( |
| (...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1368 } | 1380 } |
| 1369 | 1381 |
| 1370 void ThreadProxy::DidCompletePageScaleAnimationOnImplThread() { | 1382 void ThreadProxy::DidCompletePageScaleAnimationOnImplThread() { |
| 1371 DCHECK(IsImplThread()); | 1383 DCHECK(IsImplThread()); |
| 1372 Proxy::MainThreadTaskRunner()->PostTask( | 1384 Proxy::MainThreadTaskRunner()->PostTask( |
| 1373 FROM_HERE, base::Bind(&ThreadProxy::DidCompletePageScaleAnimation, | 1385 FROM_HERE, base::Bind(&ThreadProxy::DidCompletePageScaleAnimation, |
| 1374 main_thread_weak_ptr_)); | 1386 main_thread_weak_ptr_)); |
| 1375 } | 1387 } |
| 1376 | 1388 |
| 1377 } // namespace cc | 1389 } // namespace cc |
| OLD | NEW |