| 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 |
| 11 #include <algorithm> | 11 #include <algorithm> |
| 12 | 12 |
| 13 namespace { | 13 namespace { |
| 14 | 14 |
| 15 const unsigned int kMaxLatencyInfoNumber = 100; | 15 const size_t kMaxLatencyInfoNumber = 100; |
| 16 | 16 |
| 17 const char* GetComponentName(ui::LatencyComponentType type) { | 17 const char* GetComponentName(ui::LatencyComponentType type) { |
| 18 #define CASE_TYPE(t) case ui::t: return #t | 18 #define CASE_TYPE(t) case ui::t: return #t |
| 19 switch (type) { | 19 switch (type) { |
| 20 CASE_TYPE(INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT); | 20 CASE_TYPE(INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT); |
| 21 CASE_TYPE(INPUT_EVENT_LATENCY_SCROLL_UPDATE_RWH_COMPONENT); | 21 CASE_TYPE(INPUT_EVENT_LATENCY_SCROLL_UPDATE_RWH_COMPONENT); |
| 22 CASE_TYPE(INPUT_EVENT_LATENCY_SCROLL_UPDATE_ORIGINAL_COMPONENT); | 22 CASE_TYPE(INPUT_EVENT_LATENCY_SCROLL_UPDATE_ORIGINAL_COMPONENT); |
| 23 CASE_TYPE(INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT); | 23 CASE_TYPE(INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT); |
| 24 CASE_TYPE(INPUT_EVENT_LATENCY_UI_COMPONENT); | 24 CASE_TYPE(INPUT_EVENT_LATENCY_UI_COMPONENT); |
| 25 CASE_TYPE(INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_COMPONENT); | 25 CASE_TYPE(INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_COMPONENT); |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 } | 242 } |
| 243 | 243 |
| 244 void LatencyInfo::TraceEventType(const char* event_type) { | 244 void LatencyInfo::TraceEventType(const char* event_type) { |
| 245 TRACE_EVENT_ASYNC_STEP_INTO0("benchmark", | 245 TRACE_EVENT_ASYNC_STEP_INTO0("benchmark", |
| 246 "InputLatency", | 246 "InputLatency", |
| 247 TRACE_ID_DONT_MANGLE(trace_id), | 247 TRACE_ID_DONT_MANGLE(trace_id), |
| 248 event_type); | 248 event_type); |
| 249 } | 249 } |
| 250 | 250 |
| 251 } // namespace ui | 251 } // namespace ui |
| OLD | NEW |