| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 | 5 // A class representing an attempt to synchronize the local syncable data |
| 6 // store with a sync server. A SyncSession instance is passed as a stateful | 6 // store with a sync server. A SyncSession instance is passed as a stateful |
| 7 // bundle to and from various SyncerCommands with the goal of converging the | 7 // bundle to and from various SyncerCommands with the goal of converging the |
| 8 // client view of data with that of the server. The commands twiddle with | 8 // client view of data with that of the server. The commands twiddle with |
| 9 // session status in response to events and hiccups along the way, set and | 9 // session status in response to events and hiccups along the way, set and |
| 10 // query session progress with regards to conflict resolution and applying | 10 // query session progress with regards to conflict resolution and applying |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 | 72 |
| 73 // The client has been instructed to change its sessions commit | 73 // The client has been instructed to change its sessions commit |
| 74 // delay. | 74 // delay. |
| 75 virtual void OnReceivedSessionsCommitDelay( | 75 virtual void OnReceivedSessionsCommitDelay( |
| 76 const base::TimeDelta& new_delay) = 0; | 76 const base::TimeDelta& new_delay) = 0; |
| 77 | 77 |
| 78 // The client needs to cease and desist syncing at once. This occurs when | 78 // The client needs to cease and desist syncing at once. This occurs when |
| 79 // the Syncer detects that the backend store has fundamentally changed or | 79 // the Syncer detects that the backend store has fundamentally changed or |
| 80 // is a different instance altogether (e.g. swapping from a test instance | 80 // is a different instance altogether (e.g. swapping from a test instance |
| 81 // to production, or a global stop syncing operation has wiped the store). | 81 // to production, or a global stop syncing operation has wiped the store). |
| 82 // TODO(lipalani) : Replace this function with the two below. This function |
| 83 // stops the current sync cycle and purges the client. In the new model |
| 84 // the former would be done by the |OnRequestEarlyExit| and |
| 85 // the latter(which is an action) would be done in ProfileSyncService |
| 86 // along with the rest of the actions. |
| 82 virtual void OnShouldStopSyncingPermanently() = 0; | 87 virtual void OnShouldStopSyncingPermanently() = 0; |
| 83 | 88 |
| 89 // Stop the current sync cycle. |
| 90 virtual void OnRequestEarlyExit() = 0; |
| 91 |
| 92 // Notifies the front end that there is an actionable error. |
| 93 virtual void OnActionableError(sessions::SyncSession* session) = 0; |
| 94 |
| 84 protected: | 95 protected: |
| 85 virtual ~Delegate() {} | 96 virtual ~Delegate() {} |
| 86 }; | 97 }; |
| 87 | 98 |
| 88 SyncSession(SyncSessionContext* context, | 99 SyncSession(SyncSessionContext* context, |
| 89 Delegate* delegate, | 100 Delegate* delegate, |
| 90 const SyncSourceInfo& source, | 101 const SyncSourceInfo& source, |
| 91 const ModelSafeRoutingInfo& routing_info, | 102 const ModelSafeRoutingInfo& routing_info, |
| 92 const std::vector<ModelSafeWorker*>& workers); | 103 const std::vector<ModelSafeWorker*>& workers); |
| 93 ~SyncSession(); | 104 ~SyncSession(); |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 | 199 |
| 189 private: | 200 private: |
| 190 SyncSession* session_; | 201 SyncSession* session_; |
| 191 DISALLOW_COPY_AND_ASSIGN(ScopedSetSessionWriteTransaction); | 202 DISALLOW_COPY_AND_ASSIGN(ScopedSetSessionWriteTransaction); |
| 192 }; | 203 }; |
| 193 | 204 |
| 194 } // namespace sessions | 205 } // namespace sessions |
| 195 } // namespace browser_sync | 206 } // namespace browser_sync |
| 196 | 207 |
| 197 #endif // CHROME_BROWSER_SYNC_SESSIONS_SYNC_SESSION_H_ | 208 #endif // CHROME_BROWSER_SYNC_SESSIONS_SYNC_SESSION_H_ |
| OLD | NEW |