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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 | 195 |
196 void ThreadProxy::DidLoseOutputSurface() { | 196 void ThreadProxy::DidLoseOutputSurface() { |
197 TRACE_EVENT0("cc", "ThreadProxy::DidLoseOutputSurface"); | 197 TRACE_EVENT0("cc", "ThreadProxy::DidLoseOutputSurface"); |
198 DCHECK(IsMainThread()); | 198 DCHECK(IsMainThread()); |
199 layer_tree_host()->DidLoseOutputSurface(); | 199 layer_tree_host()->DidLoseOutputSurface(); |
200 | 200 |
201 { | 201 { |
202 DebugScopedSetMainThreadBlocked main_thread_blocked(this); | 202 DebugScopedSetMainThreadBlocked main_thread_blocked(this); |
203 | 203 |
204 // Return lost resources to their owners immediately. | 204 // Return lost resources to their owners immediately. |
205 BlockingTaskRunner::CapturePostTasks blocked; | 205 BlockingTaskRunner::CapturePostTasks blocked( |
| 206 blocking_main_thread_task_runner()); |
206 | 207 |
207 CompletionEvent completion; | 208 CompletionEvent completion; |
208 Proxy::ImplThreadTaskRunner()->PostTask( | 209 Proxy::ImplThreadTaskRunner()->PostTask( |
209 FROM_HERE, | 210 FROM_HERE, |
210 base::Bind(&ThreadProxy::DeleteContentsTexturesOnImplThread, | 211 base::Bind(&ThreadProxy::DeleteContentsTexturesOnImplThread, |
211 impl_thread_weak_ptr_, | 212 impl_thread_weak_ptr_, |
212 &completion)); | 213 &completion)); |
213 completion.Wait(); | 214 completion.Wait(); |
214 } | 215 } |
215 } | 216 } |
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
853 // point of view, but asynchronously performed on the impl thread, | 854 // point of view, but asynchronously performed on the impl thread, |
854 // coordinated by the Scheduler. | 855 // coordinated by the Scheduler. |
855 { | 856 { |
856 TRACE_EVENT0("cc", "ThreadProxy::BeginMainFrame::commit"); | 857 TRACE_EVENT0("cc", "ThreadProxy::BeginMainFrame::commit"); |
857 | 858 |
858 DebugScopedSetMainThreadBlocked main_thread_blocked(this); | 859 DebugScopedSetMainThreadBlocked main_thread_blocked(this); |
859 | 860 |
860 // This CapturePostTasks should be destroyed before CommitComplete() is | 861 // This CapturePostTasks should be destroyed before CommitComplete() is |
861 // called since that goes out to the embedder, and we want the embedder | 862 // called since that goes out to the embedder, and we want the embedder |
862 // to receive its callbacks before that. | 863 // to receive its callbacks before that. |
863 BlockingTaskRunner::CapturePostTasks blocked; | 864 BlockingTaskRunner::CapturePostTasks blocked( |
| 865 blocking_main_thread_task_runner()); |
864 | 866 |
865 CompletionEvent completion; | 867 CompletionEvent completion; |
866 Proxy::ImplThreadTaskRunner()->PostTask( | 868 Proxy::ImplThreadTaskRunner()->PostTask( |
867 FROM_HERE, | 869 FROM_HERE, |
868 base::Bind(&ThreadProxy::StartCommitOnImplThread, | 870 base::Bind(&ThreadProxy::StartCommitOnImplThread, |
869 impl_thread_weak_ptr_, | 871 impl_thread_weak_ptr_, |
870 &completion, | 872 &completion, |
871 queue.release())); | 873 queue.release())); |
872 completion.Wait(); | 874 completion.Wait(); |
873 | 875 |
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1397 | 1399 |
1398 impl().timing_history.DidActivateSyncTree(); | 1400 impl().timing_history.DidActivateSyncTree(); |
1399 } | 1401 } |
1400 | 1402 |
1401 void ThreadProxy::DidManageTiles() { | 1403 void ThreadProxy::DidManageTiles() { |
1402 DCHECK(IsImplThread()); | 1404 DCHECK(IsImplThread()); |
1403 impl().scheduler->DidManageTiles(); | 1405 impl().scheduler->DidManageTiles(); |
1404 } | 1406 } |
1405 | 1407 |
1406 } // namespace cc | 1408 } // namespace cc |
OLD | NEW |