Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3437)

Unified Diff: cc/trees/thread_proxy.cc

Issue 421183003: Revert of Add builders for tracing event's structural arguments (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/trees/thread_proxy.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
}
« no previous file with comments | « cc/trees/thread_proxy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698