| 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 CC_DEBUG_LATENCY_INFO_H_ |
| 6 #define CC_DEBUG_LATENCY_INFO_H_ | 6 #define CC_DEBUG_LATENCY_INFO_H_ |
| 7 | 7 |
| 8 #include <map> |
| 9 #include <utility> |
| 10 |
| 8 #include "base/time.h" | 11 #include "base/time.h" |
| 12 #include "cc/base/cc_export.h" |
| 9 | 13 |
| 10 namespace cc { | 14 namespace cc { |
| 11 | 15 |
| 12 struct LatencyInfo { | 16 enum LatencyComponent { |
| 13 int64 renderer_main_frame_number; | 17 kRendererMainThread, |
| 14 int64 renderer_impl_frame_number; | 18 kRendererImplThread, |
| 15 int64 browser_main_frame_number; | 19 kBrowserMainThread, |
| 16 int64 browser_impl_frame_number; | 20 kBrowserImplThread, |
| 21 kInputEvent, |
| 22 }; |
| 23 |
| 24 struct CC_EXPORT LatencyInfo { |
| 25 // Map a Latency Component (with an int64 id) to a number representing what |
| 26 // events have happened in that component. |
| 27 typedef std::map<std::pair<LatencyComponent, int64>, int64> LatencyMap; |
| 28 |
| 29 LatencyMap latency_numbers; |
| 17 | 30 |
| 18 base::TimeTicks swap_timestamp; | 31 base::TimeTicks swap_timestamp; |
| 19 | 32 |
| 20 LatencyInfo() : | 33 LatencyInfo() {} |
| 21 renderer_main_frame_number(0), | 34 |
| 22 renderer_impl_frame_number(0), | 35 void MergeWith(const LatencyInfo& other); |
| 23 browser_main_frame_number(0), | 36 |
| 24 browser_impl_frame_number(0) {} | 37 void AddLatencyNumber(LatencyComponent component, int64 id, int64 number); |
| 25 }; | 38 }; |
| 26 | 39 |
| 27 } // namespace cc | 40 } // namespace cc |
| 28 | 41 |
| 29 #endif // CC_DEBUG_LATENCY_INFO_H_ | 42 #endif // CC_DEBUG_LATENCY_INFO_H_ |
| 30 | 43 |
| OLD | NEW |