Chromium Code Reviews| 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..f64f32356f6a66d40ec0c122c2d4f98e4cddb615 100644 |
| --- a/components/metrics/metrics_reporting_scheduler.h |
| +++ b/components/metrics/metrics_reporting_scheduler.h |
| @@ -10,13 +10,19 @@ |
| #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 { |
| // Scheduler task to drive a MetricsService object's uploading. |
| class MetricsReportingScheduler { |
| public: |
| - explicit MetricsReportingScheduler(const base::Closure& upload_callback); |
| + // Creates MetricsServiceScheduler object with the given |upload_callback| |
| + // callback to call when uploading should happen and |cellular_callback| |
| + // callback to get current network connection type. |
| + MetricsReportingScheduler( |
| + const base::Closure& upload_callback, |
| + const base::Callback<void(bool*)>& cellular_callback); |
| ~MetricsReportingScheduler(); |
| // Starts scheduling uploads. This in a no-op if the scheduler is already |
| @@ -39,6 +45,9 @@ class MetricsReportingScheduler { |
| // Sets the upload interval to a specific value, exposed for unit tests. |
| void SetUploadIntervalForTesting(base::TimeDelta interval); |
| + // Sets whether the network connection is cellular or not. |
| + void SetConnectionType(bool is_cellular); |
|
Alexei Svitkine (slow)
2015/02/18 22:03:09
Is this needed anymore?
gayane -on leave until 09-2017
2015/02/19 16:24:35
Removed.
|
| + |
| private: |
| // Timer callback indicating it's time for the MetricsService to upload |
| // metrics. |
| @@ -84,6 +93,14 @@ class MetricsReportingScheduler { |
| // has been completed. |
| bool waiting_for_init_task_complete_; |
| + // Callback function from MetricsService used to get current network |
|
Alexei Svitkine (slow)
2015/02/18 22:03:09
Don't say "from MetricsService" - just what it's f
gayane -on leave until 09-2017
2015/02/19 16:24:35
Done.
|
| + // connection type. |
| + base::Callback<void(bool*)> cellular_callback_; |
| + |
| + // Indicates whether network connection is cellular or not. |
| + // Default value is |true| because cellular mode is more conservative. |
| + bool is_cellular_connection_; |
|
Alexei Svitkine (slow)
2015/02/18 22:03:08
This isn't needed anymore, right?
gayane -on leave until 09-2017
2015/02/19 16:24:35
Done.
|
| + |
| DISALLOW_COPY_AND_ASSIGN(MetricsReportingScheduler); |
| }; |