| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/debug/trace_event.h" | 5 #include "base/debug/trace_event.h" |
| 6 #include "base/json/json_writer.h" | 6 #include "base/json/json_writer.h" |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
| 9 #include "ui/events/latency_info.h" | 9 #include "ui/events/latency_info.h" |
| 10 | 10 |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 | 123 |
| 124 scoped_ptr<base::ListValue> coordinates(new base::ListValue()); | 124 scoped_ptr<base::ListValue> coordinates(new base::ListValue()); |
| 125 for (size_t i = 0; i < latency.input_coordinates_size; i++) { | 125 for (size_t i = 0; i < latency.input_coordinates_size; i++) { |
| 126 scoped_ptr<base::DictionaryValue> coordinate_pair( | 126 scoped_ptr<base::DictionaryValue> coordinate_pair( |
| 127 new base::DictionaryValue()); | 127 new base::DictionaryValue()); |
| 128 coordinate_pair->SetDouble("x", latency.input_coordinates[i].x); | 128 coordinate_pair->SetDouble("x", latency.input_coordinates[i].x); |
| 129 coordinate_pair->SetDouble("y", latency.input_coordinates[i].y); | 129 coordinate_pair->SetDouble("y", latency.input_coordinates[i].y); |
| 130 coordinates->Append(coordinate_pair.release()); | 130 coordinates->Append(coordinate_pair.release()); |
| 131 } | 131 } |
| 132 record_data->Set("coordinates", coordinates.release()); | 132 record_data->Set("coordinates", coordinates.release()); |
| 133 return LatencyInfoTracedValue::FromValue(record_data.PassAs<base::Value>()); | 133 return LatencyInfoTracedValue::FromValue(record_data.Pass()); |
| 134 } | 134 } |
| 135 | 135 |
| 136 } // namespace | 136 } // namespace |
| 137 | 137 |
| 138 namespace ui { | 138 namespace ui { |
| 139 | 139 |
| 140 LatencyInfo::InputCoordinate::InputCoordinate() : x(0), y(0) { | 140 LatencyInfo::InputCoordinate::InputCoordinate() : x(0), y(0) { |
| 141 } | 141 } |
| 142 | 142 |
| 143 LatencyInfo::InputCoordinate::InputCoordinate(float x, float y) : x(x), y(y) { | 143 LatencyInfo::InputCoordinate::InputCoordinate(float x, float y) : x(x), y(y) { |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 } | 321 } |
| 322 | 322 |
| 323 void LatencyInfo::TraceEventType(const char* event_type) { | 323 void LatencyInfo::TraceEventType(const char* event_type) { |
| 324 TRACE_EVENT_ASYNC_STEP_INTO0("benchmark", | 324 TRACE_EVENT_ASYNC_STEP_INTO0("benchmark", |
| 325 "InputLatency", | 325 "InputLatency", |
| 326 TRACE_ID_DONT_MANGLE(trace_id), | 326 TRACE_ID_DONT_MANGLE(trace_id), |
| 327 event_type); | 327 event_type); |
| 328 } | 328 } |
| 329 | 329 |
| 330 } // namespace ui | 330 } // namespace ui |
| OLD | NEW |