Chromium Code Reviews| Index: ui/events/latency_info.h |
| diff --git a/ui/events/latency_info.h b/ui/events/latency_info.h |
| index 3e50cc4f80c127b917513b65a07ebf7d29ab5571..5be36c01c476d420c1dac3a57150563e98cd480f 100644 |
| --- a/ui/events/latency_info.h |
| +++ b/ui/events/latency_info.h |
| @@ -7,6 +7,7 @@ |
| #include <map> |
| #include <utility> |
| +#include <vector> |
| #include "base/basictypes.h" |
| #include "base/time/time.h" |
| @@ -87,6 +88,16 @@ struct EVENTS_BASE_EXPORT LatencyInfo { |
| ~LatencyInfo(); |
| + // Returns true if the vector |latency_info| is valid. Returns false |
| + // if it is not valid and log the |referring_msg|. |
| + // This function is mainly used to check the latency_info vector that |
| + // is passed between processes using IPC message has reasonable size |
| + // so that we are confident the IPC message is not corrupted/compromised. |
| + // This check will go away once the IPC system has better built-in scheme |
| + // for corruption/compromise detection. |
| + static bool Verify(const std::vector<LatencyInfo>& latency_info, |
| + const char* referring_msg); |
| + |
| // Merges the contents of another LatencyInfo into this one. |
| void MergeWith(const LatencyInfo& other); |
| @@ -128,6 +139,9 @@ struct EVENTS_BASE_EXPORT LatencyInfo { |
| int64 trace_id; |
| // Whether a terminal component has been added. |
| bool terminated; |
| + |
| + static const unsigned int kMaxLatencyInfoNumber = 100; |
|
Ken Russell (switch to Gerrit)
2014/01/16 02:05:14
This could just go into latency_info.cc.
Yufeng Shen (Slow to review)
2014/01/16 03:33:17
Done.
|
| + |
| }; |
| } // namespace ui |