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

Unified Diff: cc/scheduler/delay_based_time_source.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/scheduler/delay_based_time_source.h ('k') | cc/scheduler/scheduler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/scheduler/delay_based_time_source.cc
diff --git a/cc/scheduler/delay_based_time_source.cc b/cc/scheduler/delay_based_time_source.cc
index 2be3d3d472af4af03648f770e380a073940fdd81..cd214fd98d7c5a34bc62227af900efef04b26f82 100644
--- a/cc/scheduler/delay_based_time_source.cc
+++ b/cc/scheduler/delay_based_time_source.cc
@@ -10,6 +10,7 @@
#include "base/bind.h"
#include "base/debug/trace_event.h"
+#include "base/debug/trace_event_argument.h"
#include "base/location.h"
#include "base/logging.h"
#include "base/single_thread_task_runner.h"
@@ -289,31 +290,25 @@ std::string DelayBasedTimeSourceHighRes::TypeString() const {
return "DelayBasedTimeSourceHighRes";
}
-scoped_ptr<base::Value> DelayBasedTimeSource::AsValue() const {
- scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue);
+void DelayBasedTimeSource::AsValueInto(base::debug::TracedValue* state) const {
state->SetString("type", TypeString());
state->SetDouble("last_tick_time_us", LastTickTime().ToInternalValue());
state->SetDouble("next_tick_time_us", NextTickTime().ToInternalValue());
- scoped_ptr<base::DictionaryValue> state_current_parameters(
- new base::DictionaryValue);
- state_current_parameters->SetDouble(
- "interval_us", current_parameters_.interval.InMicroseconds());
- state_current_parameters->SetDouble(
- "tick_target_us", current_parameters_.tick_target.ToInternalValue());
- state->Set("current_parameters", state_current_parameters.release());
-
- scoped_ptr<base::DictionaryValue> state_next_parameters(
- new base::DictionaryValue);
- state_next_parameters->SetDouble("interval_us",
- next_parameters_.interval.InMicroseconds());
- state_next_parameters->SetDouble(
- "tick_target_us", next_parameters_.tick_target.ToInternalValue());
- state->Set("next_parameters", state_next_parameters.release());
+ state->BeginDictionary("current_parameters");
+ state->SetDouble("interval_us",
+ current_parameters_.interval.InMicroseconds());
+ state->SetDouble("tick_target_us",
+ current_parameters_.tick_target.ToInternalValue());
+ state->EndDictionary();
- state->SetBoolean("active", active_);
+ state->BeginDictionary("next_parameters");
+ state->SetDouble("interval_us", next_parameters_.interval.InMicroseconds());
+ state->SetDouble("tick_target_us",
+ next_parameters_.tick_target.ToInternalValue());
+ state->EndDictionary();
- return state.PassAs<base::Value>();
+ state->SetBoolean("active", active_);
}
} // namespace cc
« no previous file with comments | « cc/scheduler/delay_based_time_source.h ('k') | cc/scheduler/scheduler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698