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..ca7cdca431163eb9a73a23e568f09257dc8241d9 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" |
Alexei Svitkine (slow)
2015/02/13 22:39:50
Hmm, I just realised this is problematic.
The Ne
gayane -on leave until 09-2017
2015/02/17 19:38:02
Done.
|
namespace metrics { |
@@ -39,6 +40,14 @@ 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); |
Alexei Svitkine (slow)
2015/02/13 22:39:50
No metrics:: prefix needed.
gayane -on leave until 09-2017
2015/02/17 19:38:02
removed
|
+ |
+ // Returns true if the connection type is 2G, 3G, or 4G. |
+ bool IsCellularConnection(); |
+ |
private: |
// Timer callback indicating it's time for the MetricsService to upload |
// metrics. |
@@ -57,6 +66,10 @@ class MetricsReportingScheduler { |
// (bug: 17391128). Should be removed once the experiments are done. |
base::TimeDelta GetStandardUploadInterval(); |
+ // Returns true if the user is assigned to the experiment group for enabled |
+ // cellular uploads. |
+ bool IsCellularEnabledByExperiment() |
+ |
// The MetricsService method to call when uploading should happen. |
const base::Closure upload_callback_; |
@@ -84,6 +97,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_; |
Alexei Svitkine (slow)
2015/02/13 22:39:50
Ditto.
gayane -on leave until 09-2017
2015/02/17 19:38:02
Removed
|
+ |
DISALLOW_COPY_AND_ASSIGN(MetricsReportingScheduler); |
}; |