| 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_DOMAIN_RELIABILITY_SCHEDULER_H_ | 5 #ifndef COMPONENTS_DOMAIN_RELIABILITY_SCHEDULER_H_ |
| 6 #define COMPONENTS_DOMAIN_RELIABILITY_SCHEDULER_H_ | 6 #define COMPONENTS_DOMAIN_RELIABILITY_SCHEDULER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/callback.h" | 13 #include "base/callback.h" |
| 14 #include "base/memory/scoped_vector.h" | 14 #include "base/memory/scoped_vector.h" |
| 15 #include "base/time/time.h" | 15 #include "base/time/time.h" |
| 16 #include "components/domain_reliability/domain_reliability_export.h" | 16 #include "components/domain_reliability/domain_reliability_export.h" |
| 17 #include "components/domain_reliability/uploader.h" | 17 #include "components/domain_reliability/uploader.h" |
| 18 #include "net/base/backoff_entry.h" | 18 #include "net/base/backoff_entry.h" |
| 19 | 19 |
| 20 namespace base { | 20 namespace base { |
| 21 class Value; | 21 class Value; |
| 22 } // namespace base | 22 } // namespace base |
| 23 | 23 |
| 24 namespace domain_reliability { | 24 namespace domain_reliability { |
| 25 | 25 |
| 26 struct DomainReliabilityConfig; | |
| 27 class MockableTime; | 26 class MockableTime; |
| 28 | 27 |
| 29 // Determines when an upload should be scheduled. A domain's config will | 28 // Determines when an upload should be scheduled. A domain's config will |
| 30 // specify minimum and maximum upload delays; the minimum upload delay ensures | 29 // specify minimum and maximum upload delays; the minimum upload delay ensures |
| 31 // that Chrome will not send too many upload requests to a site by waiting at | 30 // that Chrome will not send too many upload requests to a site by waiting at |
| 32 // least that long after the first beacon, while the maximum upload delay makes | 31 // least that long after the first beacon, while the maximum upload delay makes |
| 33 // sure the server receives the reports while they are still fresh. | 32 // sure the server receives the reports while they are still fresh. |
| 34 // | 33 // |
| 35 // When everything is working fine, the scheduler will return precisely that | 34 // When everything is working fine, the scheduler will return precisely that |
| 36 // interval. If all uploaders have failed, then the beginning or ending points | 35 // interval. If all uploaders have failed, then the beginning or ending points |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 bool last_upload_finished_; | 139 bool last_upload_finished_; |
| 141 base::TimeTicks last_upload_start_time_; | 140 base::TimeTicks last_upload_start_time_; |
| 142 base::TimeTicks last_upload_end_time_; | 141 base::TimeTicks last_upload_end_time_; |
| 143 size_t last_upload_collector_index_; | 142 size_t last_upload_collector_index_; |
| 144 bool last_upload_success_; | 143 bool last_upload_success_; |
| 145 }; | 144 }; |
| 146 | 145 |
| 147 } // namespace domain_reliability | 146 } // namespace domain_reliability |
| 148 | 147 |
| 149 #endif // COMPONENTS_DOMAIN_RELIABILITY_SCHEDULER_H_ | 148 #endif // COMPONENTS_DOMAIN_RELIABILITY_SCHEDULER_H_ |
| OLD | NEW |