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

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

Issue 81533002: Use LatencyInfoSwapPromise to track LatencyInfo through compositor (Closed) Base URL: http://git.chromium.org/chromium/src.git@swap_promise_2
Patch Set: fix typo Created 7 years 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 const char* GetComponentName(ui::LatencyComponentType type) { 14 const char* GetComponentName(ui::LatencyComponentType type) {
15 #define CASE_TYPE(t) case ui::t: return #t 15 #define CASE_TYPE(t) case ui::t: return #t
16 switch (type) { 16 switch (type) {
17 CASE_TYPE(INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT); 17 CASE_TYPE(INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT);
18 CASE_TYPE(INPUT_EVENT_LATENCY_SCROLL_UPDATE_RWH_COMPONENT); 18 CASE_TYPE(INPUT_EVENT_LATENCY_SCROLL_UPDATE_RWH_COMPONENT);
19 CASE_TYPE(INPUT_EVENT_LATENCY_SCROLL_UPDATE_ORIGINAL_COMPONENT); 19 CASE_TYPE(INPUT_EVENT_LATENCY_SCROLL_UPDATE_ORIGINAL_COMPONENT);
20 CASE_TYPE(INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT); 20 CASE_TYPE(INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT);
21 CASE_TYPE(INPUT_EVENT_LATENCY_UI_COMPONENT); 21 CASE_TYPE(INPUT_EVENT_LATENCY_UI_COMPONENT);
22 CASE_TYPE(INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_COMPONENT); 22 CASE_TYPE(INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_COMPONENT);
23 CASE_TYPE(INPUT_EVENT_LATENCY_ACKED_TOUCH_COMPONENT); 23 CASE_TYPE(INPUT_EVENT_LATENCY_ACKED_TOUCH_COMPONENT);
24 CASE_TYPE(WINDOW_SNAPSHOT_FRAME_NUMBER_COMPONENT);
24 CASE_TYPE(INPUT_EVENT_LATENCY_TERMINATED_MOUSE_COMPONENT); 25 CASE_TYPE(INPUT_EVENT_LATENCY_TERMINATED_MOUSE_COMPONENT);
25 CASE_TYPE(INPUT_EVENT_LATENCY_TERMINATED_TOUCH_COMPONENT); 26 CASE_TYPE(INPUT_EVENT_LATENCY_TERMINATED_TOUCH_COMPONENT);
26 CASE_TYPE(INPUT_EVENT_LATENCY_TERMINATED_GESTURE_COMPONENT); 27 CASE_TYPE(INPUT_EVENT_LATENCY_TERMINATED_GESTURE_COMPONENT);
27 CASE_TYPE(INPUT_EVENT_LATENCY_TERMINATED_FRAME_SWAP_COMPONENT); 28 CASE_TYPE(INPUT_EVENT_LATENCY_TERMINATED_FRAME_SWAP_COMPONENT);
29 CASE_TYPE(INPUT_EVENT_LATENCY_TERMINATED_COMMIT_FAILED_COMPONENT);
30 CASE_TYPE(INPUT_EVENT_LATENCY_TERMINATED_SWAP_FAILED_COMPONENT);
31 CASE_TYPE(LATENCY_INFO_LIST_TERMINATED_OVERFLOW_COMPONENT);
28 default: 32 default:
29 DLOG(WARNING) << "Unhandled LatencyComponentType.\n"; 33 DLOG(WARNING) << "Unhandled LatencyComponentType.\n";
30 break; 34 break;
31 } 35 }
32 #undef CASE_TYPE 36 #undef CASE_TYPE
33 return "unknown"; 37 return "unknown";
34 } 38 }
35 39
36 bool IsTerminalComponent(ui::LatencyComponentType type) { 40 bool IsTerminalComponent(ui::LatencyComponentType type) {
37 switch (type) { 41 switch (type) {
38 case ui::INPUT_EVENT_LATENCY_TERMINATED_MOUSE_COMPONENT: 42 case ui::INPUT_EVENT_LATENCY_TERMINATED_MOUSE_COMPONENT:
39 case ui::INPUT_EVENT_LATENCY_TERMINATED_TOUCH_COMPONENT: 43 case ui::INPUT_EVENT_LATENCY_TERMINATED_TOUCH_COMPONENT:
40 case ui::INPUT_EVENT_LATENCY_TERMINATED_GESTURE_COMPONENT: 44 case ui::INPUT_EVENT_LATENCY_TERMINATED_GESTURE_COMPONENT:
41 case ui::INPUT_EVENT_LATENCY_TERMINATED_FRAME_SWAP_COMPONENT: 45 case ui::INPUT_EVENT_LATENCY_TERMINATED_FRAME_SWAP_COMPONENT:
46 case ui::INPUT_EVENT_LATENCY_TERMINATED_COMMIT_FAILED_COMPONENT:
47 case ui::INPUT_EVENT_LATENCY_TERMINATED_SWAP_FAILED_COMPONENT:
48 case ui::LATENCY_INFO_LIST_TERMINATED_OVERFLOW_COMPONENT:
42 return true; 49 return true;
43 default: 50 default:
44 return false; 51 return false;
45 } 52 }
46 } 53 }
47 54
48 bool IsBeginComponent(ui::LatencyComponentType type) { 55 bool IsBeginComponent(ui::LatencyComponentType type) {
49 return (type == ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT); 56 return (type == ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT);
50 } 57 }
51 58
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 it++; 223 it++;
217 } 224 }
218 } 225 }
219 } 226 }
220 227
221 void LatencyInfo::Clear() { 228 void LatencyInfo::Clear() {
222 latency_components.clear(); 229 latency_components.clear();
223 } 230 }
224 231
225 } // namespace ui 232 } // 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