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

Unified Diff: ui/events/latency_info.cc

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/events/latency_info.h ('k') | ui/surface/accelerated_surface_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/latency_info.cc
diff --git a/ui/events/latency_info.cc b/ui/events/latency_info.cc
index a3a11828db041ee90e844c9076a4d3bd70fb24e3..dd5e11c3141899d3a1350a6def8fc30950b4a281 100644
--- a/ui/events/latency_info.cc
+++ b/ui/events/latency_info.cc
@@ -11,6 +11,9 @@
#include <algorithm>
namespace {
+
+const unsigned int kMaxLatencyInfoNumber = 100;
+
const char* GetComponentName(ui::LatencyComponentType type) {
#define CASE_TYPE(t) case ui::t: return #t
switch (type) {
@@ -119,6 +122,16 @@ LatencyInfo::LatencyInfo() : trace_id(-1), terminated(false) {
LatencyInfo::~LatencyInfo() {
}
+bool LatencyInfo::Verify(const std::vector<LatencyInfo>& latency_info,
+ const char* referring_msg) {
+ if (latency_info.size() > kMaxLatencyInfoNumber) {
+ LOG(ERROR) << referring_msg << ", LatencyInfo vector size "
+ << latency_info.size() << " is too big.";
+ return false;
+ }
+ return true;
+}
+
void LatencyInfo::MergeWith(const LatencyInfo& other) {
for (LatencyMap::const_iterator it = other.latency_components.begin();
it != other.latency_components.end();
« no previous file with comments | « ui/events/latency_info.h ('k') | ui/surface/accelerated_surface_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698