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

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

Issue 123563002: Remove gpu side LatencyInfo merging (Closed) Base URL: http://git.chromium.org/chromium/src.git@gpu-per-event-latency-6-small
Patch Set: fix mac_rel compiler error. Move kMaxLatencyInfoNumber to .cc file Created 6 years, 11 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 | « content/common/view_messages.h ('k') | ui/events/latency_info.cc » ('j') | 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 #ifndef UI_EVENTS_LATENCY_INFO_H_ 5 #ifndef UI_EVENTS_LATENCY_INFO_H_
6 #define UI_EVENTS_LATENCY_INFO_H_ 6 #define UI_EVENTS_LATENCY_INFO_H_
7 7
8 #include <map> 8 #include <map>
9 #include <utility> 9 #include <utility>
10 #include <vector>
10 11
11 #include "base/basictypes.h" 12 #include "base/basictypes.h"
12 #include "base/time/time.h" 13 #include "base/time/time.h"
13 #include "ui/events/events_base_export.h" 14 #include "ui/events/events_base_export.h"
14 15
15 namespace ui { 16 namespace ui {
16 17
17 enum LatencyComponentType { 18 enum LatencyComponentType {
18 // ---------------------------BEGIN COMPONENT------------------------------- 19 // ---------------------------BEGIN COMPONENT-------------------------------
19 // BEGIN COMPONENT is when we show the latency begin in chrome://tracing. 20 // BEGIN COMPONENT is when we show the latency begin in chrome://tracing.
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 81
81 // Map a Latency Component (with a component-specific int64 id) to a 82 // Map a Latency Component (with a component-specific int64 id) to a
82 // component info. 83 // component info.
83 typedef std::map<std::pair<LatencyComponentType, int64>, LatencyComponent> 84 typedef std::map<std::pair<LatencyComponentType, int64>, LatencyComponent>
84 LatencyMap; 85 LatencyMap;
85 86
86 LatencyInfo(); 87 LatencyInfo();
87 88
88 ~LatencyInfo(); 89 ~LatencyInfo();
89 90
91 // Returns true if the vector |latency_info| is valid. Returns false
92 // if it is not valid and log the |referring_msg|.
93 // This function is mainly used to check the latency_info vector that
94 // is passed between processes using IPC message has reasonable size
95 // so that we are confident the IPC message is not corrupted/compromised.
96 // This check will go away once the IPC system has better built-in scheme
97 // for corruption/compromise detection.
98 static bool Verify(const std::vector<LatencyInfo>& latency_info,
99 const char* referring_msg);
100
90 // Merges the contents of another LatencyInfo into this one. 101 // Merges the contents of another LatencyInfo into this one.
91 void MergeWith(const LatencyInfo& other); 102 void MergeWith(const LatencyInfo& other);
92 103
93 // Add LatencyComponents that are in |other| but not in |this|. 104 // Add LatencyComponents that are in |other| but not in |this|.
94 void AddNewLatencyFrom(const LatencyInfo& other); 105 void AddNewLatencyFrom(const LatencyInfo& other);
95 106
96 // Modifies the current sequence number for a component, and adds a new 107 // Modifies the current sequence number for a component, and adds a new
97 // sequence number with the current timestamp. 108 // sequence number with the current timestamp.
98 void AddLatencyNumber(LatencyComponentType component, 109 void AddLatencyNumber(LatencyComponentType component,
99 int64 id, 110 int64 id,
(...skipping 26 matching lines...) Expand all
126 LatencyMap latency_components; 137 LatencyMap latency_components;
127 // The unique id for matching the ASYNC_BEGIN/END trace event. 138 // The unique id for matching the ASYNC_BEGIN/END trace event.
128 int64 trace_id; 139 int64 trace_id;
129 // Whether a terminal component has been added. 140 // Whether a terminal component has been added.
130 bool terminated; 141 bool terminated;
131 }; 142 };
132 143
133 } // namespace ui 144 } // namespace ui
134 145
135 #endif // UI_EVENTS_LATENCY_INFO_H_ 146 #endif // UI_EVENTS_LATENCY_INFO_H_
OLDNEW
« no previous file with comments | « content/common/view_messages.h ('k') | ui/events/latency_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698