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 #ifndef CC_DEBUG_LATENCY_INFO_H_ | 5 #ifndef UI_BASE_LATENCY_INFO_H_ |
6 #define CC_DEBUG_LATENCY_INFO_H_ | 6 #define UI_BASE_LATENCY_INFO_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/time.h" | 12 #include "base/time.h" |
13 #include "cc/base/cc_export.h" | 13 #include "ui/base/ui_export.h" |
14 | 14 |
15 namespace cc { | 15 namespace ui { |
16 | 16 |
17 enum LatencyComponentType { | 17 enum LatencyComponentType { |
18 kRendererMainThread, | 18 INPUT_EVENT_LATENCY_COMPONENT, |
sky
2013/05/16 15:38:32
Why do you have an enum with a single value?
jbauman
2013/05/20 16:48:22
In my next set of patches I want to extend this fo
| |
19 kRendererImplThread, | |
20 kBrowserMainThread, | |
21 kBrowserImplThread, | |
22 kInputEvent, | |
23 }; | 19 }; |
24 | 20 |
25 struct CC_EXPORT LatencyInfo { | 21 class UI_EXPORT LatencyInfo { |
22 public: | |
26 struct LatencyComponent { | 23 struct LatencyComponent { |
27 // Nondecreasing number that can be used to determine what events happened | 24 // Nondecreasing number that can be used to determine what events happened |
28 // in the component at the time this struct was sent on to the next | 25 // in the component at the time this struct was sent on to the next |
29 // component. | 26 // component. |
30 int64 sequence_number; | 27 int64 sequence_number; |
31 // Average time of events that happened in this component. | 28 // Average time of events that happened in this component. |
32 base::TimeTicks event_time; | 29 base::TimeTicks event_time; |
33 // Count of events that happened in this component | 30 // Count of events that happened in this component |
34 uint32 event_count; | 31 uint32 event_count; |
35 }; | 32 }; |
36 | 33 |
37 // Map a Latency Component (with a component-specific int64 id) to a | 34 // Map a Latency Component (with a component-specific int64 id) to a |
38 // component info. | 35 // component info. |
39 typedef std::map<std::pair<LatencyComponentType, int64>, LatencyComponent> | 36 typedef std::map<std::pair<LatencyComponentType, int64>, LatencyComponent> |
40 LatencyMap; | 37 LatencyMap; |
41 | 38 |
42 LatencyMap latency_components; | 39 LatencyMap latency_components; |
sky
2013/05/16 15:38:32
members should always be private and end with an '
jbauman
2013/05/20 16:48:22
Yeah, I've been vacillating about whether to chang
sky
2013/05/20 19:55:15
If you go with class, then all members private and
| |
43 | 40 |
44 // This represents the final time that a frame is displayed it. | 41 // This represents the final time that a frame is displayed it. |
45 base::TimeTicks swap_timestamp; | 42 base::TimeTicks swap_timestamp; |
46 | 43 |
47 LatencyInfo(); | 44 LatencyInfo(); |
48 | 45 |
49 ~LatencyInfo(); | 46 ~LatencyInfo(); |
50 | 47 |
51 void MergeWith(const LatencyInfo& other); | 48 void MergeWith(const LatencyInfo& other); |
52 | 49 |
53 void AddLatencyNumber(LatencyComponentType component, int64 id, | 50 void AddLatencyNumber(LatencyComponentType component, |
sky
2013/05/16 15:38:32
Add descriptions.
| |
51 int64 id, | |
54 int64 component_sequence_number); | 52 int64 component_sequence_number); |
55 void AddLatencyNumberWithTimestamp(LatencyComponentType component, | 53 void AddLatencyNumberWithTimestamp(LatencyComponentType component, |
56 int64 id, int64 component_sequence_number, | 54 int64 id, |
55 int64 component_sequence_number, | |
57 base::TimeTicks time, | 56 base::TimeTicks time, |
58 uint32 event_count); | 57 uint32 event_count); |
59 | 58 |
60 void Clear(); | 59 void Clear(); |
61 }; | 60 }; |
sky
2013/05/16 15:38:32
private:DISALLOW_COPY_AND_ASSIGN
jbauman
2013/05/20 16:48:22
This is stored in STL datastructures, so I can't d
| |
62 | 61 |
63 } // namespace cc | 62 } // namespace ui |
64 | 63 |
65 #endif // CC_DEBUG_LATENCY_INFO_H_ | 64 #endif // UI_BASE_LATENCY_INFO_H_ |
66 | 65 |
OLD | NEW |