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

Unified Diff: cc/scheduler/compositor_timing_history.cc

Issue 1229853004: Base: Make TimeDelta constructors deal with overflow. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove static initializers Created 5 years, 5 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 | « base/time/time_unittest.cc ('k') | chrome/browser/sync/sync_stopped_reporter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/scheduler/compositor_timing_history.cc
diff --git a/cc/scheduler/compositor_timing_history.cc b/cc/scheduler/compositor_timing_history.cc
index 437278c7976f0d8da3cf24ff7cc0da11ec12e1bd..cbec9d63dbc296c0bdfad561aed327e048406370 100644
--- a/cc/scheduler/compositor_timing_history.cc
+++ b/cc/scheduler/compositor_timing_history.cc
@@ -45,8 +45,8 @@ const double kPrepareTilesEstimationPercentile = 100.0;
const double kActivateEstimationPercentile = 100.0;
const double kDrawEstimationPercentile = 100.0;
-const base::TimeDelta kUmaDurationMin = base::TimeDelta::FromMicroseconds(1);
-const base::TimeDelta kUmaDurationMax = base::TimeDelta::FromSeconds(1);
+const int kUmaDurationMin_uS = 1;
+const int64 kUmaDurationMax_uS = 1 * base::Time::kMicrosecondsPerSecond;
const size_t kUmaDurationBucketCount = 100;
// Deprecated because they combine Browser and Renderer stats and have low
@@ -73,10 +73,10 @@ void DeprecatedDrawDurationUMA(base::TimeDelta duration,
base::TimeDelta::FromMilliseconds(100), 50);
}
-#define UMA_HISTOGRAM_CUSTOM_TIMES_MICROS(name, sample) \
- UMA_HISTOGRAM_CUSTOM_COUNTS( \
- name, sample.InMicroseconds(), kUmaDurationMin.InMicroseconds(), \
- kUmaDurationMax.InMicroseconds(), kUmaDurationBucketCount);
+#define UMA_HISTOGRAM_CUSTOM_TIMES_MICROS(name, sample) \
+ UMA_HISTOGRAM_CUSTOM_COUNTS( \
+ name, sample.InMicroseconds(), kUmaDurationMin_uS, \
+ kUmaDurationMax_uS, kUmaDurationBucketCount);
#define REPORT_COMPOSITOR_TIMING_HISTORY_UMA(category, subcategory) \
do { \
« no previous file with comments | « base/time/time_unittest.cc ('k') | chrome/browser/sync/sync_stopped_reporter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698