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/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "cc/delay_based_time_source.h" | 10 #include "cc/delay_based_time_source.h" |
(...skipping 1070 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1081 | 1081 |
1082 ThreadProxy::BeginFrameAndCommitState::BeginFrameAndCommitState() | 1082 ThreadProxy::BeginFrameAndCommitState::BeginFrameAndCommitState() |
1083 : memoryAllocationLimitBytes(0) | 1083 : memoryAllocationLimitBytes(0) |
1084 { | 1084 { |
1085 } | 1085 } |
1086 | 1086 |
1087 ThreadProxy::BeginFrameAndCommitState::~BeginFrameAndCommitState() | 1087 ThreadProxy::BeginFrameAndCommitState::~BeginFrameAndCommitState() |
1088 { | 1088 { |
1089 } | 1089 } |
1090 | 1090 |
| 1091 scoped_ptr<base::Value> ThreadProxy::asValue() const |
| 1092 { |
| 1093 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); |
| 1094 |
| 1095 CompletionEvent completion; |
| 1096 { |
| 1097 DebugScopedSetMainThreadBlocked mainThreadBlocked( |
| 1098 const_cast<ThreadProxy*>(this)); |
| 1099 Proxy::implThread()->postTask(base::Bind(&ThreadProxy::asValueOnImplThre
ad, |
| 1100 m_implThreadWeakPtr, |
| 1101 &completion, |
| 1102 state.get())); |
| 1103 completion.wait(); |
| 1104 } |
| 1105 return state.PassAs<base::Value>(); |
| 1106 } |
| 1107 |
| 1108 void ThreadProxy::asValueOnImplThread(CompletionEvent* completion, base::Diction
aryValue* state) const |
| 1109 { |
| 1110 state->Set("layer_tree_host_impl", m_layerTreeHostImpl->asValue().release())
; |
| 1111 completion->signal(); |
| 1112 } |
| 1113 |
1091 bool ThreadProxy::commitPendingForTesting() | 1114 bool ThreadProxy::commitPendingForTesting() |
1092 { | 1115 { |
1093 DCHECK(isMainThread()); | 1116 DCHECK(isMainThread()); |
1094 CommitPendingRequest commitPendingRequest; | 1117 CommitPendingRequest commitPendingRequest; |
1095 { | 1118 { |
1096 DebugScopedSetMainThreadBlocked mainThreadBlocked(this); | 1119 DebugScopedSetMainThreadBlocked mainThreadBlocked(this); |
1097 Proxy::implThread()->postTask(base::Bind(&ThreadProxy::commitPendingOnIm
plThreadForTesting, m_implThreadWeakPtr, &commitPendingRequest)); | 1120 Proxy::implThread()->postTask(base::Bind(&ThreadProxy::commitPendingOnIm
plThreadForTesting, m_implThreadWeakPtr, &commitPendingRequest)); |
1098 commitPendingRequest.completion.wait(); | 1121 commitPendingRequest.completion.wait(); |
1099 } | 1122 } |
1100 return commitPendingRequest.commitPending; | 1123 return commitPendingRequest.commitPending; |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1188 | 1211 |
1189 void ThreadProxy::renewTreePriorityOnImplThread() | 1212 void ThreadProxy::renewTreePriorityOnImplThread() |
1190 { | 1213 { |
1191 DCHECK(m_renewTreePriorityOnImplThreadPending); | 1214 DCHECK(m_renewTreePriorityOnImplThreadPending); |
1192 m_renewTreePriorityOnImplThreadPending = false; | 1215 m_renewTreePriorityOnImplThreadPending = false; |
1193 | 1216 |
1194 renewTreePriority(); | 1217 renewTreePriority(); |
1195 } | 1218 } |
1196 | 1219 |
1197 } // namespace cc | 1220 } // namespace cc |
OLD | NEW |