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 778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
789 bool can_cancel_this_commit = | 789 bool can_cancel_this_commit = |
790 main().can_cancel_commit && !begin_main_frame_state->evicted_ui_resources; | 790 main().can_cancel_commit && !begin_main_frame_state->evicted_ui_resources; |
791 main().can_cancel_commit = true; | 791 main().can_cancel_commit = true; |
792 | 792 |
793 scoped_ptr<ResourceUpdateQueue> queue = | 793 scoped_ptr<ResourceUpdateQueue> queue = |
794 make_scoped_ptr(new ResourceUpdateQueue); | 794 make_scoped_ptr(new ResourceUpdateQueue); |
795 | 795 |
796 bool updated = layer_tree_host()->UpdateLayers(queue.get()); | 796 bool updated = layer_tree_host()->UpdateLayers(queue.get()); |
797 | 797 |
798 layer_tree_host()->WillCommit(); | 798 layer_tree_host()->WillCommit(); |
| 799 devtools_instrumentation::ScopedCommitTrace commit_task( |
| 800 layer_tree_host()->id()); |
799 | 801 |
800 // Before calling animate, we set main().animate_requested to false. If it is | 802 // Before calling animate, we set main().animate_requested to false. If it is |
801 // true now, it means SetNeedAnimate was called again, but during a state when | 803 // true now, it means SetNeedAnimate was called again, but during a state when |
802 // main().commit_request_sent_to_impl_thread = true. We need to force that | 804 // main().commit_request_sent_to_impl_thread = true. We need to force that |
803 // call to happen again now so that the commit request is sent to the impl | 805 // call to happen again now so that the commit request is sent to the impl |
804 // thread. | 806 // thread. |
805 if (main().animate_requested) { | 807 if (main().animate_requested) { |
806 // Forces SetNeedsAnimate to consider posting a commit task. | 808 // Forces SetNeedsAnimate to consider posting a commit task. |
807 main().animate_requested = false; | 809 main().animate_requested = false; |
808 SetNeedsAnimate(); | 810 SetNeedsAnimate(); |
(...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1365 } | 1367 } |
1366 | 1368 |
1367 void ThreadProxy::DidCompletePageScaleAnimationOnImplThread() { | 1369 void ThreadProxy::DidCompletePageScaleAnimationOnImplThread() { |
1368 DCHECK(IsImplThread()); | 1370 DCHECK(IsImplThread()); |
1369 Proxy::MainThreadTaskRunner()->PostTask( | 1371 Proxy::MainThreadTaskRunner()->PostTask( |
1370 FROM_HERE, base::Bind(&ThreadProxy::DidCompletePageScaleAnimation, | 1372 FROM_HERE, base::Bind(&ThreadProxy::DidCompletePageScaleAnimation, |
1371 main_thread_weak_ptr_)); | 1373 main_thread_weak_ptr_)); |
1372 } | 1374 } |
1373 | 1375 |
1374 } // namespace cc | 1376 } // namespace cc |
OLD | NEW |