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

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: singleton pattern removed 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..a7f3691efa6854d17b2a438adc248f21f755dba4 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;
-
- return cellular_callback_.Run();
+ bool is_cellular_enabled = false;
+ if (!cellular_callback_.is_null()) {
Alexei Svitkine (slow) 2016/03/29 16:29:11 Nit: No {}'s for 1-liner ifs.
gayane -on leave until 09-2017 2016/03/31 01:38:24 Done.
+ cellular_callback_.Run(&is_cellular_enabled);
+ }
+ return is_cellular_enabled;
}
} // namespace metrics

Powered by Google App Engine
This is Rietveld 408576698