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

Unified Diff: components/metrics/metrics_reporting_scheduler.h

Issue 922383003: Enable UMA log uploads for cellular networks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: upload interval based on the connection type Created 5 years, 10 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/metrics_reporting_scheduler.h
diff --git a/components/metrics/metrics_reporting_scheduler.h b/components/metrics/metrics_reporting_scheduler.h
index 19f07570663727eb2c8c259b91fb073fd0477e8d..839882feac2011ecbcd1847f0fa0ad5a718786a2 100644
--- a/components/metrics/metrics_reporting_scheduler.h
+++ b/components/metrics/metrics_reporting_scheduler.h
@@ -10,6 +10,7 @@
#include "base/memory/weak_ptr.h"
#include "base/time/time.h"
#include "base/timer/timer.h"
+#include "components/metrics/net/network_metrics_provider.h"
namespace metrics {
@@ -39,6 +40,13 @@ class MetricsReportingScheduler {
// Sets the upload interval to a specific value, exposed for unit tests.
void SetUploadIntervalForTesting(base::TimeDelta interval);
+ // Sets class variable |network_metrics_provider| for having access to
+ // connection type.
+ void SetNetworkMetricsProvider(
+ const metrics::NetworkMetricsProvider* network_metrics_provider);
+
+ // Returns true if the connection type is 2G, 3G, or 4G.
+ bool IsCellularConnection();
Alexei Svitkine (slow) 2015/02/13 21:11:41 Nit: Add an empty line after this.
gayane -on leave until 09-2017 2015/02/13 22:23:13 Done.
private:
// Timer callback indicating it's time for the MetricsService to upload
// metrics.
@@ -84,6 +92,9 @@ class MetricsReportingScheduler {
// has been completed.
bool waiting_for_init_task_complete_;
+ // Used to get the connection type for deciding on upload interval.
+ const metrics::NetworkMetricsProvider* network_metrics_provider_;
+
DISALLOW_COPY_AND_ASSIGN(MetricsReportingScheduler);
};

Powered by Google App Engine
This is Rietveld 408576698