| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 virtual bool IsSyncingCurrentlySilenced() = 0; | 58 virtual bool IsSyncingCurrentlySilenced() = 0; |
| 59 | 59 |
| 60 // The client has been instructed to change its short poll interval. | 60 // The client has been instructed to change its short poll interval. |
| 61 virtual void OnReceivedShortPollIntervalUpdate( | 61 virtual void OnReceivedShortPollIntervalUpdate( |
| 62 const base::TimeDelta& new_interval) = 0; | 62 const base::TimeDelta& new_interval) = 0; |
| 63 | 63 |
| 64 // The client has been instructed to change its long poll interval. | 64 // The client has been instructed to change its long poll interval. |
| 65 virtual void OnReceivedLongPollIntervalUpdate( | 65 virtual void OnReceivedLongPollIntervalUpdate( |
| 66 const base::TimeDelta& new_interval) = 0; | 66 const base::TimeDelta& new_interval) = 0; |
| 67 | 67 |
| 68 // The client needs to cease and desist syncing at once. This occurs when |
| 69 // the Syncer detects that the backend store has fundamentally changed or |
| 70 // is a different instance altogether (e.g. swapping from a test instance |
| 71 // to production, or a global stop syncing operation has wiped the store). |
| 72 virtual void OnShouldStopSyncingPermanently() = 0; |
| 73 |
| 68 protected: | 74 protected: |
| 69 virtual ~Delegate() {} | 75 virtual ~Delegate() {} |
| 70 }; | 76 }; |
| 71 | 77 |
| 72 // Creates a new SyncSession with mandatory context and delegate. | 78 // Creates a new SyncSession with mandatory context and delegate. |
| 73 SyncSession(SyncSessionContext* context, Delegate* delegate); | 79 SyncSession(SyncSessionContext* context, Delegate* delegate); |
| 74 | 80 |
| 75 // Builds a thread-safe and read-only copy of the current session state. | 81 // Builds a thread-safe and read-only copy of the current session state. |
| 76 SyncSessionSnapshot TakeSnapshot() const; | 82 SyncSessionSnapshot TakeSnapshot() const; |
| 77 | 83 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 | 158 |
| 153 private: | 159 private: |
| 154 SyncSession* session_; | 160 SyncSession* session_; |
| 155 DISALLOW_COPY_AND_ASSIGN(ScopedSetSessionWriteTransaction); | 161 DISALLOW_COPY_AND_ASSIGN(ScopedSetSessionWriteTransaction); |
| 156 }; | 162 }; |
| 157 | 163 |
| 158 } // namespace sessions | 164 } // namespace sessions |
| 159 } // namespace browser_sync | 165 } // namespace browser_sync |
| 160 | 166 |
| 161 #endif // CHROME_BROWSER_SYNC_SESSIONS_SYNC_SESSION_H_ | 167 #endif // CHROME_BROWSER_SYNC_SESSIONS_SYNC_SESSION_H_ |
| OLD | NEW |