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

Unified Diff: cc/trees/thread_proxy.cc

Issue 380763002: Add builders for tracing event's structural arguments (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed memory leak found by Linux ASAN 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 03e7afc8ec242eb1ecc6e07fee715d89b392454c..b18b93a63518f976b00ff36c570f4b5ae57c7346 100644
--- a/cc/trees/thread_proxy.cc
+++ b/cc/trees/thread_proxy.cc
@@ -10,6 +10,7 @@
#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"
@@ -1295,28 +1296,27 @@ ThreadProxy::BeginMainFrameAndCommitState::BeginMainFrameAndCommitState()
ThreadProxy::BeginMainFrameAndCommitState::~BeginMainFrameAndCommitState() {}
-scoped_ptr<base::Value> ThreadProxy::AsValue() const {
- scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue());
-
+void ThreadProxy::AsValueInto(base::debug::TracedValue* state) const {
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.get()));
+ state_refptr));
completion.Wait();
}
- return state.PassAs<base::Value>();
}
void ThreadProxy::AsValueOnImplThread(CompletionEvent* completion,
- base::DictionaryValue* state) const {
- state->Set("layer_tree_host_impl",
- impl().layer_tree_host_impl->AsValue().release());
+ base::debug::TracedValue* state) const {
+ state->BeginDictionary("layer_tree_host_impl");
+ impl().layer_tree_host_impl->AsValueInto(state);
+ state->EndDictionary();
completion->Signal();
}
@@ -1345,30 +1345,6 @@ void ThreadProxy::CommitPendingOnImplThreadForTesting(
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();
-}
-
void ThreadProxy::RenewTreePriority() {
DCHECK(IsImplThread());
bool smoothness_takes_priority =
« 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