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

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

Issue 19670007: Send input event's LatencyInfo back from renderer to browser when acked (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: change PopTouchEventWithAck(ack) to PopTouchEventToClient(ack, latency_info) Created 7 years, 4 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/base/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 "ui/base/latency_info.h" 5 #include "ui/base/latency_info.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 namespace ui { 9 namespace ui {
10 10
11 LatencyInfo::LatencyInfo() { 11 LatencyInfo::LatencyInfo() {
12 } 12 }
13 13
14 LatencyInfo::~LatencyInfo() { 14 LatencyInfo::~LatencyInfo() {
15 } 15 }
16 16
17 void LatencyInfo::MergeWith(const LatencyInfo& other) { 17 void LatencyInfo::MergeWith(const LatencyInfo& other) {
18 for (LatencyMap::const_iterator it = other.latency_components.begin(); 18 for (LatencyMap::const_iterator it = other.latency_components.begin();
19 it != other.latency_components.end(); 19 it != other.latency_components.end();
20 ++it) { 20 ++it) {
21 AddLatencyNumberWithTimestamp(it->first.first, 21 AddLatencyNumberWithTimestamp(it->first.first,
22 it->first.second, 22 it->first.second,
23 it->second.sequence_number, 23 it->second.sequence_number,
24 it->second.event_time, 24 it->second.event_time,
25 it->second.event_count); 25 it->second.event_count);
26 } 26 }
27 } 27 }
28 28
29 void LatencyInfo::AddNewLatencyFrom(const LatencyInfo& other) {
30 for (LatencyMap::const_iterator it = other.latency_components.begin();
sadrul 2013/08/06 19:49:31 Fix indentation
Yufeng Shen (Slow to review) 2013/08/06 20:01:04 Done.
31 it != other.latency_components.end();
32 ++it) {
33 if (!FindLatency(it->first.first, it->first.second, NULL)) {
34 AddLatencyNumberWithTimestamp(it->first.first,
35 it->first.second,
36 it->second.sequence_number,
37 it->second.event_time,
38 it->second.event_count);
39 }
40 }
41 }
42
29 void LatencyInfo::AddLatencyNumber(LatencyComponentType component, 43 void LatencyInfo::AddLatencyNumber(LatencyComponentType component,
30 int64 id, 44 int64 id,
31 int64 component_sequence_number) { 45 int64 component_sequence_number) {
32 AddLatencyNumberWithTimestamp(component, id, component_sequence_number, 46 AddLatencyNumberWithTimestamp(component, id, component_sequence_number,
33 base::TimeTicks::HighResNow(), 1); 47 base::TimeTicks::HighResNow(), 1);
34 } 48 }
35 49
36 void LatencyInfo::AddLatencyNumberWithTimestamp(LatencyComponentType component, 50 void LatencyInfo::AddLatencyNumberWithTimestamp(LatencyComponentType component,
37 int64 id, 51 int64 id,
38 int64 component_sequence_number, 52 int64 component_sequence_number,
(...skipping 29 matching lines...) Expand all
68 if (output) 82 if (output)
69 *output = it->second; 83 *output = it->second;
70 return true; 84 return true;
71 } 85 }
72 86
73 void LatencyInfo::Clear() { 87 void LatencyInfo::Clear() {
74 latency_components.clear(); 88 latency_components.clear();
75 } 89 }
76 90
77 } // namespace ui 91 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/latency_info.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698