| 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 "ui/events/latency_info.h" | 5 #include "ui/events/latency_info.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 CHECK(!terminated); | 331 CHECK(!terminated); |
| 332 terminated = true; | 332 terminated = true; |
| 333 | 333 |
| 334 if (*benchmark_enabled) { | 334 if (*benchmark_enabled) { |
| 335 TRACE_EVENT_COPY_ASYNC_END1("benchmark,latencyInfo", | 335 TRACE_EVENT_COPY_ASYNC_END1("benchmark,latencyInfo", |
| 336 trace_name.c_str(), | 336 trace_name.c_str(), |
| 337 TRACE_ID_DONT_MANGLE(trace_id), | 337 TRACE_ID_DONT_MANGLE(trace_id), |
| 338 "data", AsTraceableData(*this)); | 338 "data", AsTraceableData(*this)); |
| 339 } | 339 } |
| 340 | 340 |
| 341 TRACE_EVENT_FLOW_END0( | 341 TRACE_EVENT_FLOW_END_BIND_TO_ENCLOSING0( |
| 342 "input,benchmark", "LatencyInfo.Flow", TRACE_ID_DONT_MANGLE(trace_id)); | 342 "input,benchmark", "LatencyInfo.Flow", TRACE_ID_DONT_MANGLE(trace_id)); |
| 343 } | 343 } |
| 344 } | 344 } |
| 345 | 345 |
| 346 bool LatencyInfo::FindLatency(LatencyComponentType type, | 346 bool LatencyInfo::FindLatency(LatencyComponentType type, |
| 347 int64 id, | 347 int64 id, |
| 348 LatencyComponent* output) const { | 348 LatencyComponent* output) const { |
| 349 LatencyMap::const_iterator it = latency_components.find( | 349 LatencyMap::const_iterator it = latency_components.find( |
| 350 std::make_pair(type, id)); | 350 std::make_pair(type, id)); |
| 351 if (it == latency_components.end()) | 351 if (it == latency_components.end()) |
| (...skipping 14 matching lines...) Expand all Loading... |
| 366 it++; | 366 it++; |
| 367 } | 367 } |
| 368 } | 368 } |
| 369 } | 369 } |
| 370 | 370 |
| 371 void LatencyInfo::Clear() { | 371 void LatencyInfo::Clear() { |
| 372 latency_components.clear(); | 372 latency_components.clear(); |
| 373 } | 373 } |
| 374 | 374 |
| 375 } // namespace ui | 375 } // namespace ui |
| OLD | NEW |