| 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 // A class representing an attempt to synchronize the local syncable data | |
| 6 // store with a sync server. A SyncCycle instance is passed as a stateful | |
| 7 // bundle throughout the sync cycle. The SyncCycle is not reused across | |
| 8 // sync cycles; each cycle starts with a new one. | |
| 9 | |
| 10 #ifndef COMPONENTS_SYNC_ENGINE_IMPL_CYCLE_SYNC_CYCLE_H_ | 5 #ifndef COMPONENTS_SYNC_ENGINE_IMPL_CYCLE_SYNC_CYCLE_H_ |
| 11 #define COMPONENTS_SYNC_ENGINE_IMPL_CYCLE_SYNC_CYCLE_H_ | 6 #define COMPONENTS_SYNC_ENGINE_IMPL_CYCLE_SYNC_CYCLE_H_ |
| 12 | 7 |
| 13 #include <map> | 8 #include <map> |
| 14 #include <memory> | 9 #include <memory> |
| 15 #include <set> | 10 #include <set> |
| 16 #include <string> | 11 #include <string> |
| 17 #include <utility> | 12 #include <utility> |
| 18 #include <vector> | 13 #include <vector> |
| 19 | 14 |
| 20 #include "base/macros.h" | 15 #include "base/macros.h" |
| 21 #include "base/time/time.h" | 16 #include "base/time/time.h" |
| 22 #include "components/sync/base/model_type.h" | 17 #include "components/sync/base/model_type.h" |
| 23 #include "components/sync/engine/cycle/sync_cycle_snapshot.h" | 18 #include "components/sync/engine/cycle/sync_cycle_snapshot.h" |
| 24 #include "components/sync/engine/model_safe_worker.h" | 19 #include "components/sync/engine/model_safe_worker.h" |
| 25 #include "components/sync/engine_impl/cycle/status_controller.h" | 20 #include "components/sync/engine_impl/cycle/status_controller.h" |
| 26 #include "components/sync/engine_impl/cycle/sync_cycle_context.h" | 21 #include "components/sync/engine_impl/cycle/sync_cycle_context.h" |
| 27 #include "components/sync/engine_impl/sync_cycle_event.h" | 22 #include "components/sync/engine_impl/sync_cycle_event.h" |
| 28 #include "components/sync/protocol/sync_protocol_error.h" | 23 #include "components/sync/protocol/sync_protocol_error.h" |
| 29 | 24 |
| 30 namespace syncer { | 25 namespace syncer { |
| 31 | 26 |
| 32 class ModelSafeWorker; | 27 class ModelSafeWorker; |
| 33 class NudgeTracker; | 28 class NudgeTracker; |
| 34 class ProtocolEvent; | 29 class ProtocolEvent; |
| 35 | 30 |
| 31 // A class representing an attempt to synchronize the local syncable data |
| 32 // store with a sync server. A SyncCycle instance is passed as a stateful |
| 33 // bundle throughout the sync cycle. The SyncCycle is not reused across |
| 34 // sync cycles; each cycle starts with a new one. |
| 36 class SyncCycle { | 35 class SyncCycle { |
| 37 public: | 36 public: |
| 38 // The Delegate services events that occur during the cycle requiring an | 37 // The Delegate services events that occur during the cycle requiring an |
| 39 // explicit (and cycle-global) action, as opposed to events that are simply | 38 // explicit (and cycle-global) action, as opposed to events that are simply |
| 40 // recorded in per-cycle state. | 39 // recorded in per-cycle state. |
| 41 class Delegate { | 40 class Delegate { |
| 42 public: | 41 public: |
| 43 // The client was throttled and should cease-and-desist syncing activity | 42 // The client was throttled and should cease-and-desist syncing activity |
| 44 // until the specified time. | 43 // until the specified time. |
| 45 virtual void OnThrottled(const base::TimeDelta& throttle_duration) = 0; | 44 virtual void OnThrottled(const base::TimeDelta& throttle_duration) = 0; |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 | 127 |
| 129 // Our controller for various status and error counters. | 128 // Our controller for various status and error counters. |
| 130 std::unique_ptr<StatusController> status_controller_; | 129 std::unique_ptr<StatusController> status_controller_; |
| 131 | 130 |
| 132 DISALLOW_COPY_AND_ASSIGN(SyncCycle); | 131 DISALLOW_COPY_AND_ASSIGN(SyncCycle); |
| 133 }; | 132 }; |
| 134 | 133 |
| 135 } // namespace syncer | 134 } // namespace syncer |
| 136 | 135 |
| 137 #endif // COMPONENTS_SYNC_ENGINE_IMPL_CYCLE_SYNC_CYCLE_H_ | 136 #endif // COMPONENTS_SYNC_ENGINE_IMPL_CYCLE_SYNC_CYCLE_H_ |
| OLD | NEW |