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

Unified Diff: content/browser/tracing/background_tracing_manager_impl.cc

Issue 1408243009: Background tracing: Disable when highres clock is not available (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/tracing/background_tracing_manager_impl.cc
diff --git a/content/browser/tracing/background_tracing_manager_impl.cc b/content/browser/tracing/background_tracing_manager_impl.cc
index 70215ba36275cd92babc9fbfb646ad4638fad115..be40081fa7558055bc1f7705e6d98f7f0daa4656 100644
--- a/content/browser/tracing/background_tracing_manager_impl.cc
+++ b/content/browser/tracing/background_tracing_manager_impl.cc
@@ -37,6 +37,7 @@ enum BackgroundTracingMetrics {
FINALIZATION_DISALLOWED = 6,
FINALIZATION_STARTED = 7,
FINALIZATION_COMPLETE = 8,
+ SCENARIO_ACTION_FAILED_LOWRES_CLOCK = 9,
NUMBER_OF_BACKGROUND_TRACING_METRICS,
};
@@ -132,6 +133,13 @@ bool BackgroundTracingManagerImpl::SetActiveScenario(
if (is_tracing_)
return false;
+ // If we don't have a high resolution timer available, traces will be
+ // too inaccurate to be useful.
+ if (!base::TimeTicks::IsHighResolution()) {
+ RecordBackgroundTracingMetric(SCENARIO_ACTION_FAILED_LOWRES_CLOCK);
+ return false;
+ }
+
bool requires_anonymized_data = (data_filtering == ANONYMIZE_DATA);
// If the I/O thread isn't running, this is a startup scenario and
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698