| Index: cc/trees/thread_proxy.cc
|
| diff --git a/cc/trees/thread_proxy.cc b/cc/trees/thread_proxy.cc
|
| index b18b93a63518f976b00ff36c570f4b5ae57c7346..03e7afc8ec242eb1ecc6e07fee715d89b392454c 100644
|
| --- a/cc/trees/thread_proxy.cc
|
| +++ b/cc/trees/thread_proxy.cc
|
| @@ -10,7 +10,6 @@
|
| #include "base/auto_reset.h"
|
| #include "base/bind.h"
|
| #include "base/debug/trace_event.h"
|
| -#include "base/debug/trace_event_argument.h"
|
| #include "base/debug/trace_event_synthetic_delay.h"
|
| #include "cc/base/swap_promise.h"
|
| #include "cc/debug/benchmark_instrumentation.h"
|
| @@ -1296,27 +1295,28 @@
|
|
|
| ThreadProxy::BeginMainFrameAndCommitState::~BeginMainFrameAndCommitState() {}
|
|
|
| -void ThreadProxy::AsValueInto(base::debug::TracedValue* state) const {
|
| +scoped_ptr<base::Value> ThreadProxy::AsValue() const {
|
| + scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue());
|
| +
|
| CompletionEvent completion;
|
| {
|
| DebugScopedSetMainThreadBlocked main_thread_blocked(
|
| const_cast<ThreadProxy*>(this));
|
| - scoped_refptr<base::debug::TracedValue> state_refptr(state);
|
| Proxy::ImplThreadTaskRunner()->PostTask(
|
| FROM_HERE,
|
| base::Bind(&ThreadProxy::AsValueOnImplThread,
|
| impl_thread_weak_ptr_,
|
| &completion,
|
| - state_refptr));
|
| + state.get()));
|
| completion.Wait();
|
| }
|
| + return state.PassAs<base::Value>();
|
| }
|
|
|
| void ThreadProxy::AsValueOnImplThread(CompletionEvent* completion,
|
| - base::debug::TracedValue* state) const {
|
| - state->BeginDictionary("layer_tree_host_impl");
|
| - impl().layer_tree_host_impl->AsValueInto(state);
|
| - state->EndDictionary();
|
| + base::DictionaryValue* state) const {
|
| + state->Set("layer_tree_host_impl",
|
| + impl().layer_tree_host_impl->AsValue().release());
|
| completion->Signal();
|
| }
|
|
|
| @@ -1342,6 +1342,30 @@
|
| request->commit_pending = impl().scheduler->CommitPending();
|
| else
|
| request->commit_pending = false;
|
| + request->completion.Signal();
|
| +}
|
| +
|
| +scoped_ptr<base::Value> ThreadProxy::SchedulerAsValueForTesting() {
|
| + if (IsImplThread())
|
| + return impl().scheduler->AsValue().Pass();
|
| +
|
| + SchedulerStateRequest scheduler_state_request;
|
| + {
|
| + DebugScopedSetMainThreadBlocked main_thread_blocked(this);
|
| + Proxy::ImplThreadTaskRunner()->PostTask(
|
| + FROM_HERE,
|
| + base::Bind(&ThreadProxy::SchedulerAsValueOnImplThreadForTesting,
|
| + impl_thread_weak_ptr_,
|
| + &scheduler_state_request));
|
| + scheduler_state_request.completion.Wait();
|
| + }
|
| + return scheduler_state_request.state.Pass();
|
| +}
|
| +
|
| +void ThreadProxy::SchedulerAsValueOnImplThreadForTesting(
|
| + SchedulerStateRequest* request) {
|
| + DCHECK(IsImplThread());
|
| + request->state = impl().scheduler->AsValue();
|
| request->completion.Signal();
|
| }
|
|
|
|
|