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

Side by Side Diff: ui/events/latency_info.cc

Issue 157003005: Replace std::map with base::SmallMap in ui::LatencyInfo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 9 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 unified diff | Download patch
« no previous file with comments | « ui/events/latency_info.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « ui/events/latency_info.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698