Chromium Code Reviews| 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" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 59 | 59 |
| 60 // The MetricsService method to call when uploading should happen. | 60 // The MetricsService method to call when uploading should happen. |
| 61 const base::Closure upload_callback_; | 61 const base::Closure upload_callback_; |
| 62 | 62 |
| 63 base::OneShotTimer<MetricsReportingScheduler> upload_timer_; | 63 base::OneShotTimer<MetricsReportingScheduler> upload_timer_; |
| 64 | 64 |
| 65 // The interval between being told an upload is done and starting the next | 65 // The interval between being told an upload is done and starting the next |
| 66 // upload. | 66 // upload. |
| 67 base::TimeDelta upload_interval_; | 67 base::TimeDelta upload_interval_; |
| 68 | 68 |
| 69 // The tick count of the last time log upload has been finished and 0 if no | |
|
Alexei Svitkine (slow)
2014/10/15 20:44:19
Nit: "and 0" -> "and null"
gayane -on leave until 09-2017
2014/10/15 21:02:00
Done.
| |
| 70 // upload has been done yet. | |
| 71 base::TimeTicks last_upload_finish_time_; | |
| 72 | |
| 69 // Indicates that the scheduler is running (i.e., that Start has been called | 73 // Indicates that the scheduler is running (i.e., that Start has been called |
| 70 // more recently than Stop). | 74 // more recently than Stop). |
| 71 bool running_; | 75 bool running_; |
| 72 | 76 |
| 73 // Indicates that the last triggered upload hasn't resolved yet. | 77 // Indicates that the last triggered upload hasn't resolved yet. |
| 74 bool callback_pending_; | 78 bool callback_pending_; |
| 75 | 79 |
| 76 // Whether the InitTaskComplete() callback has been called. | 80 // Whether the InitTaskComplete() callback has been called. |
| 77 bool init_task_complete_; | 81 bool init_task_complete_; |
| 78 | 82 |
| 79 // Whether the initial scheduled upload timer has fired before the init task | 83 // Whether the initial scheduled upload timer has fired before the init task |
| 80 // has been completed. | 84 // has been completed. |
| 81 bool waiting_for_init_task_complete_; | 85 bool waiting_for_init_task_complete_; |
| 82 | 86 |
| 83 DISALLOW_COPY_AND_ASSIGN(MetricsReportingScheduler); | 87 DISALLOW_COPY_AND_ASSIGN(MetricsReportingScheduler); |
| 84 }; | 88 }; |
| 85 | 89 |
| 86 } // namespace metrics | 90 } // namespace metrics |
| 87 | 91 |
| 88 #endif // COMPONENTS_METRICS_METRICS_REPORTING_SCHEDULER_H_ | 92 #endif // COMPONENTS_METRICS_METRICS_REPORTING_SCHEDULER_H_ |
| OLD | NEW |