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

Unified Diff: components/metrics/profiler/profiler_metrics_provider.cc

Issue 1818613002: Implement UMA log throttling for cellular connections (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
Index: components/metrics/profiler/profiler_metrics_provider.cc
diff --git a/components/metrics/profiler/profiler_metrics_provider.cc b/components/metrics/profiler/profiler_metrics_provider.cc
index df64e293aee53f32b739a8c70055002b71f20842..0ea8bc1bc5d6576f3acc50f0b059b62176fe3403 100644
--- a/components/metrics/profiler/profiler_metrics_provider.cc
+++ b/components/metrics/profiler/profiler_metrics_provider.cc
@@ -76,9 +76,8 @@ ProfilerMetricsProvider::ProfilerMetricsProvider() {
}
ProfilerMetricsProvider::ProfilerMetricsProvider(
- const base::Callback<bool(void)>& cellular_callback)
- : cellular_callback_(cellular_callback) {
-}
+ const base::Callback<void(bool*)>& cellular_callback)
+ : cellular_callback_(cellular_callback) {}
ProfilerMetricsProvider::~ProfilerMetricsProvider() {
}
@@ -126,10 +125,11 @@ void ProfilerMetricsProvider::RecordProfilerData(
}
bool ProfilerMetricsProvider::IsCellularLogicEnabled() {
- if (cellular_callback_.is_null())
- return false;
+ bool is_cellular_enabled = false;
+ if (!cellular_callback_.is_null())
+ cellular_callback_.Run(&is_cellular_enabled);
- return cellular_callback_.Run();
+ return is_cellular_enabled;
}
} // namespace metrics

Powered by Google App Engine
This is Rietveld 408576698