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/thread_proxy.h" | 5 #include "cc/thread_proxy.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "cc/delay_based_time_source.h" | 9 #include "cc/delay_based_time_source.h" |
10 #include "cc/draw_quad.h" | 10 #include "cc/draw_quad.h" |
(...skipping 959 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
970 | 970 |
971 ThreadProxy::BeginFrameAndCommitState::BeginFrameAndCommitState() | 971 ThreadProxy::BeginFrameAndCommitState::BeginFrameAndCommitState() |
972 : memoryAllocationLimitBytes(0) | 972 : memoryAllocationLimitBytes(0) |
973 { | 973 { |
974 } | 974 } |
975 | 975 |
976 ThreadProxy::BeginFrameAndCommitState::~BeginFrameAndCommitState() | 976 ThreadProxy::BeginFrameAndCommitState::~BeginFrameAndCommitState() |
977 { | 977 { |
978 } | 978 } |
979 | 979 |
| 980 bool ThreadProxy::commitPendingForTesting() |
| 981 { |
| 982 DCHECK(isMainThread()); |
| 983 CommitPendingRequest commitPendingRequest; |
| 984 { |
| 985 DebugScopedSetMainThreadBlocked mainThreadBlocked(this); |
| 986 Proxy::implThread()->postTask(base::Bind(&ThreadProxy::commitPendingOnIm
plThreadForTesting, base::Unretained(this), &commitPendingRequest)); |
| 987 commitPendingRequest.completion.wait(); |
| 988 } |
| 989 return commitPendingRequest.commitPending; |
| 990 } |
| 991 |
| 992 void ThreadProxy::commitPendingOnImplThreadForTesting(CommitPendingRequest* requ
est) |
| 993 { |
| 994 DCHECK(isImplThread()); |
| 995 request->commitPending = m_schedulerOnImplThread->commitPending(); |
| 996 request->completion.signal(); |
| 997 } |
| 998 |
980 } // namespace cc | 999 } // namespace cc |
OLD | NEW |