| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 // Increases the upload interval each time it's called, to handle the case | 57 // Increases the upload interval each time it's called, to handle the case |
| 58 // where the server is having issues. | 58 // where the server is having issues. |
| 59 void BackOffUploadInterval(); | 59 void BackOffUploadInterval(); |
| 60 | 60 |
| 61 // Returns upload interval to use in steady state. | 61 // Returns upload interval to use in steady state. |
| 62 base::TimeDelta GetStandardUploadInterval(); | 62 base::TimeDelta GetStandardUploadInterval(); |
| 63 | 63 |
| 64 // The MetricsService method to call when uploading should happen. | 64 // The MetricsService method to call when uploading should happen. |
| 65 const base::Closure upload_callback_; | 65 const base::Closure upload_callback_; |
| 66 | 66 |
| 67 base::OneShotTimer<MetricsReportingScheduler> upload_timer_; | 67 base::OneShotTimer upload_timer_; |
| 68 | 68 |
| 69 // The interval between being told an upload is done and starting the next | 69 // The interval between being told an upload is done and starting the next |
| 70 // upload. | 70 // upload. |
| 71 base::TimeDelta upload_interval_; | 71 base::TimeDelta upload_interval_; |
| 72 | 72 |
| 73 // The tick count of the last time log upload has been finished and null if no | 73 // The tick count of the last time log upload has been finished and null if no |
| 74 // upload has been done yet. | 74 // upload has been done yet. |
| 75 base::TimeTicks last_upload_finish_time_; | 75 base::TimeTicks last_upload_finish_time_; |
| 76 | 76 |
| 77 // Indicates that the scheduler is running (i.e., that Start has been called | 77 // Indicates that the scheduler is running (i.e., that Start has been called |
| (...skipping 12 matching lines...) Expand all Loading... |
| 90 | 90 |
| 91 // Callback function used to get the standard upload time. | 91 // Callback function used to get the standard upload time. |
| 92 base::Callback<base::TimeDelta(void)> upload_interval_callback_; | 92 base::Callback<base::TimeDelta(void)> upload_interval_callback_; |
| 93 | 93 |
| 94 DISALLOW_COPY_AND_ASSIGN(MetricsReportingScheduler); | 94 DISALLOW_COPY_AND_ASSIGN(MetricsReportingScheduler); |
| 95 }; | 95 }; |
| 96 | 96 |
| 97 } // namespace metrics | 97 } // namespace metrics |
| 98 | 98 |
| 99 #endif // COMPONENTS_METRICS_METRICS_REPORTING_SCHEDULER_H_ | 99 #endif // COMPONENTS_METRICS_METRICS_REPORTING_SCHEDULER_H_ |
| OLD | NEW |