| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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_SYNC_ENGINE_IMPL_CYCLE_SYNC_CYCLE_H_ | 5 #ifndef COMPONENTS_SYNC_ENGINE_IMPL_CYCLE_SYNC_CYCLE_H_ |
| 6 #define COMPONENTS_SYNC_ENGINE_IMPL_CYCLE_SYNC_CYCLE_H_ | 6 #define COMPONENTS_SYNC_ENGINE_IMPL_CYCLE_SYNC_CYCLE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 class Delegate { | 40 class Delegate { |
| 41 public: | 41 public: |
| 42 // The client was throttled and should cease-and-desist syncing activity | 42 // The client was throttled and should cease-and-desist syncing activity |
| 43 // until the specified time. | 43 // until the specified time. |
| 44 virtual void OnThrottled(const base::TimeDelta& throttle_duration) = 0; | 44 virtual void OnThrottled(const base::TimeDelta& throttle_duration) = 0; |
| 45 | 45 |
| 46 // Some of the client's types were throttled. | 46 // Some of the client's types were throttled. |
| 47 virtual void OnTypesThrottled(ModelTypeSet types, | 47 virtual void OnTypesThrottled(ModelTypeSet types, |
| 48 const base::TimeDelta& throttle_duration) = 0; | 48 const base::TimeDelta& throttle_duration) = 0; |
| 49 | 49 |
| 50 // Some of the client's types were backed off. |
| 51 virtual void OnTypesBackedOff(ModelTypeSet types) = 0; |
| 52 |
| 50 // Silenced intervals can be out of phase with individual cycles, so the | 53 // Silenced intervals can be out of phase with individual cycles, so the |
| 51 // delegate is the only thing that can give an authoritative answer for | 54 // delegate is the only thing that can give an authoritative answer for |
| 52 // "is syncing silenced right now". This shouldn't be necessary very often | 55 // "is syncing silenced right now". This shouldn't be necessary very often |
| 53 // as the delegate ensures no cycle is started if syncing is silenced. | 56 // as the delegate ensures no cycle is started if syncing is silenced. |
| 54 // ** Note ** This will return true if silencing commenced during this | 57 // ** Note ** This will return true if silencing commenced during this |
| 55 // cycle and the interval has not yet elapsed, but the contract here is | 58 // cycle and the interval has not yet elapsed, but the contract here is |
| 56 // solely based on absolute time values. So, this cannot be used to infer | 59 // solely based on absolute time values. So, this cannot be used to infer |
| 57 // that any given cycle _instance_ is silenced. An example of reasonable | 60 // that any given cycle _instance_ is silenced. An example of reasonable |
| 58 // use is for UI reporting. | 61 // use is for UI reporting. |
| 59 virtual bool IsCurrentlyThrottled() = 0; | 62 virtual bool IsCurrentlyThrottled() = 0; |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 | 130 |
| 128 // Our controller for various status and error counters. | 131 // Our controller for various status and error counters. |
| 129 std::unique_ptr<StatusController> status_controller_; | 132 std::unique_ptr<StatusController> status_controller_; |
| 130 | 133 |
| 131 DISALLOW_COPY_AND_ASSIGN(SyncCycle); | 134 DISALLOW_COPY_AND_ASSIGN(SyncCycle); |
| 132 }; | 135 }; |
| 133 | 136 |
| 134 } // namespace syncer | 137 } // namespace syncer |
| 135 | 138 |
| 136 #endif // COMPONENTS_SYNC_ENGINE_IMPL_CYCLE_SYNC_CYCLE_H_ | 139 #endif // COMPONENTS_SYNC_ENGINE_IMPL_CYCLE_SYNC_CYCLE_H_ |
| OLD | NEW |