diff options
author | tdresser <tdresser@chromium.org> | 2015-10-23 05:39:10 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-10-23 12:40:01 +0000 |
commit | d9401c4ff03f1d4c97894119f43d48a1006f238a (patch) | |
tree | 85804a85d0299fcbac56d06c635aa06a201b4750 /ui | |
parent | 3e6e8c3fe7a7da85bfe73b61cd7cad2f83efb282 (diff) | |
download | chromium_src-d9401c4ff03f1d4c97894119f43d48a1006f238a.zip chromium_src-d9401c4ff03f1d4c97894119f43d48a1006f238a.tar.gz chromium_src-d9401c4ff03f1d4c97894119f43d48a1006f238a.tar.bz2 |
Split coordinates out of primary InputLatency trace dictionary.
BUG=546093
Review URL: https://codereview.chromium.org/1417273002
Cr-Commit-Position: refs/heads/master@{#355768}
Diffstat (limited to 'ui')
-rw-r--r-- | ui/events/latency_info.cc | 15 | ||||
-rw-r--r-- | ui/events/latency_info.h | 2 |
2 files changed, 11 insertions, 6 deletions
diff --git a/ui/events/latency_info.cc b/ui/events/latency_info.cc index 34e277a..88e413f 100644 --- a/ui/events/latency_info.cc +++ b/ui/events/latency_info.cc @@ -303,10 +303,10 @@ void LatencyInfo::AddLatencyNumberWithTimestampImpl( terminated_ = true; if (*benchmark_enabled) { - TRACE_EVENT_COPY_ASYNC_END1("benchmark,latencyInfo", - trace_name_.c_str(), - TRACE_ID_DONT_MANGLE(trace_id_), - "data", AsTraceableData()); + TRACE_EVENT_COPY_ASYNC_END2("benchmark,latencyInfo", trace_name_.c_str(), + TRACE_ID_DONT_MANGLE(trace_id_), "data", + AsTraceableData(), "coordinates", + CoordinatesAsTraceableData()); } TRACE_EVENT_WITH_FLOW0("input,benchmark", @@ -332,7 +332,11 @@ LatencyInfo::AsTraceableData() { record_data->Set(GetComponentName(lc.first.first), component_info.Pass()); } record_data->SetDouble("trace_id", static_cast<double>(trace_id_)); + return LatencyInfoTracedValue::FromValue(record_data.Pass()); +} +scoped_refptr<base::trace_event::ConvertableToTraceFormat> +LatencyInfo::CoordinatesAsTraceableData() { scoped_ptr<base::ListValue> coordinates(new base::ListValue()); for (size_t i = 0; i < input_coordinates_size_; i++) { scoped_ptr<base::DictionaryValue> coordinate_pair( @@ -341,8 +345,7 @@ LatencyInfo::AsTraceableData() { coordinate_pair->SetDouble("y", input_coordinates_[i].y); coordinates->Append(coordinate_pair.release()); } - record_data->Set("coordinates", coordinates.release()); - return LatencyInfoTracedValue::FromValue(record_data.Pass()); + return LatencyInfoTracedValue::FromValue(coordinates.Pass()); } bool LatencyInfo::FindLatency(LatencyComponentType type, diff --git a/ui/events/latency_info.h b/ui/events/latency_info.h index 4ce0c9e..51373f0 100644 --- a/ui/events/latency_info.h +++ b/ui/events/latency_info.h @@ -213,6 +213,8 @@ class EVENTS_BASE_EXPORT LatencyInfo { // Converts latencyinfo into format that can be dumped into trace buffer. scoped_refptr<base::trace_event::ConvertableToTraceFormat> AsTraceableData(); + scoped_refptr<base::trace_event::ConvertableToTraceFormat> + CoordinatesAsTraceableData(); // Shown as part of the name of the trace event for this LatencyInfo. // String is empty if no tracing is enabled. |