Chromium Code Reviews| Index: cc/debug/latency_info.h |
| diff --git a/cc/debug/latency_info.h b/cc/debug/latency_info.h |
| index 1e75db8f93b8c051d24bc761baf3f39873867915..109d8fa556e35704fcac50579b40f43351983d25 100644 |
| --- a/cc/debug/latency_info.h |
| +++ b/cc/debug/latency_info.h |
| @@ -5,23 +5,55 @@ |
| #ifndef CC_DEBUG_LATENCY_INFO_H_ |
| #define CC_DEBUG_LATENCY_INFO_H_ |
| +#include <map> |
| +#include <utility> |
| + |
| #include "base/time.h" |
| +#include "cc/base/cc_export.h" |
| namespace cc { |
| -struct LatencyInfo { |
| - int64 renderer_main_frame_number; |
| - int64 renderer_impl_frame_number; |
| - int64 browser_main_frame_number; |
| - int64 browser_impl_frame_number; |
| +enum LatencyComponent { |
| + kRendererMainThread, |
| + kRendererImplThread, |
| + kBrowserMainThread, |
| + kBrowserImplThread, |
| + kInputEvent, |
| +}; |
| +struct CC_EXPORT LatencyInfo { |
| + struct ComponentInfo { |
|
nduca
2013/04/15 16:49:23
This should match the typename you've got up highe
|
| + // Nondecreasing number that can be used to determine what events happened |
| + // in the component at the time this struct was sent on to the next |
| + // component. |
| + int64 sequence_number; |
| + // Average time of events that happened in this component. |
| + base::TimeTicks event_time; |
| + // Count of events that happened in this component |
| + int event_count; |
| + }; |
| + |
| + // Map a Latency Component (with a component-specific int64 id) to a |
| + // component info. |
| + typedef std::map<std::pair<LatencyComponent, int64>, ComponentInfo> |
| + LatencyMap; |
| + |
| + LatencyMap latency_numbers; |
|
nduca
2013/04/15 16:49:23
this name should match whatever the type name. lat
|
| + |
| + // This represents the final time that a frame is displayed it. |
| base::TimeTicks swap_timestamp; |
| - LatencyInfo() : |
| - renderer_main_frame_number(0), |
| - renderer_impl_frame_number(0), |
| - browser_main_frame_number(0), |
| - browser_impl_frame_number(0) {} |
| + LatencyInfo() {} |
| + |
| + void MergeWith(const LatencyInfo& other); |
| + |
| + void AddLatencyNumber(LatencyComponent component, int64 id, |
| + int64 component_sequence_number); |
| + void AddLatencyNumberWithTimestamp(LatencyComponent component, |
| + int64 id, int64 component_sequence_number, |
| + base::TimeTicks time, int event_count); |
| + |
| + void Clear(); |
| }; |
| } // namespace cc |