OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef COMPONENTS_METRICS_METRICS_REPORTING_SCHEDULER_H_ | 5 #ifndef COMPONENTS_METRICS_METRICS_REPORTING_SCHEDULER_H_ |
6 #define COMPONENTS_METRICS_METRICS_REPORTING_SCHEDULER_H_ | 6 #define COMPONENTS_METRICS_METRICS_REPORTING_SCHEDULER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
11 #include "base/time/time.h" | 11 #include "base/time/time.h" |
12 #include "base/timer/timer.h" | 12 #include "base/timer/timer.h" |
13 | 13 |
| 14 namespace metrics { |
| 15 |
14 // Scheduler task to drive a MetricsService object's uploading. | 16 // Scheduler task to drive a MetricsService object's uploading. |
15 class MetricsReportingScheduler { | 17 class MetricsReportingScheduler { |
16 public: | 18 public: |
17 explicit MetricsReportingScheduler(const base::Closure& upload_callback); | 19 explicit MetricsReportingScheduler(const base::Closure& upload_callback); |
18 ~MetricsReportingScheduler(); | 20 ~MetricsReportingScheduler(); |
19 | 21 |
20 // Starts scheduling uploads. This in a no-op if the scheduler is already | 22 // Starts scheduling uploads. This in a no-op if the scheduler is already |
21 // running, so it is safe to call more than once. | 23 // running, so it is safe to call more than once. |
22 void Start(); | 24 void Start(); |
23 | 25 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 // Whether the InitTaskComplete() callback has been called. | 70 // Whether the InitTaskComplete() callback has been called. |
69 bool init_task_complete_; | 71 bool init_task_complete_; |
70 | 72 |
71 // Whether the initial scheduled upload timer has fired before the init task | 73 // Whether the initial scheduled upload timer has fired before the init task |
72 // has been completed. | 74 // has been completed. |
73 bool waiting_for_init_task_complete_; | 75 bool waiting_for_init_task_complete_; |
74 | 76 |
75 DISALLOW_COPY_AND_ASSIGN(MetricsReportingScheduler); | 77 DISALLOW_COPY_AND_ASSIGN(MetricsReportingScheduler); |
76 }; | 78 }; |
77 | 79 |
| 80 } // namespace metrics |
| 81 |
78 #endif // COMPONENTS_METRICS_METRICS_REPORTING_SCHEDULER_H_ | 82 #endif // COMPONENTS_METRICS_METRICS_REPORTING_SCHEDULER_H_ |
OLD | NEW |