| 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 const std::vector<ModelSafeWorker*>& workers); | 101 const std::vector<ModelSafeWorker*>& workers); |
| 102 ~SyncSession(); | 102 ~SyncSession(); |
| 103 | 103 |
| 104 // Builds a thread-safe and read-only copy of the current session state. | 104 // Builds a thread-safe and read-only copy of the current session state. |
| 105 SyncSessionSnapshot TakeSnapshot() const; | 105 SyncSessionSnapshot TakeSnapshot() const; |
| 106 | 106 |
| 107 // Returns true if this session contains data that should go through the sync | 107 // Returns true if this session contains data that should go through the sync |
| 108 // engine again. | 108 // engine again. |
| 109 bool HasMoreToSync() const; | 109 bool HasMoreToSync() const; |
| 110 | 110 |
| 111 // Returns true if this session experienced an error that could possibly go |
| 112 // away on its own. This suggests a good course of action would be to try |
| 113 // again later. |
| 114 bool ExperiencedTransientError() const; |
| 115 |
| 111 // Collects all state pertaining to how and why |s| originated and unions it | 116 // Collects all state pertaining to how and why |s| originated and unions it |
| 112 // with corresponding state in |this|, leaving |s| unchanged. Allows |this| | 117 // with corresponding state in |this|, leaving |s| unchanged. Allows |this| |
| 113 // to take on the responsibilities |s| had (e.g. certain data types) in the | 118 // to take on the responsibilities |s| had (e.g. certain data types) in the |
| 114 // next SyncShare operation using |this|, rather than needed two separate | 119 // next SyncShare operation using |this|, rather than needed two separate |
| 115 // sessions. | 120 // sessions. |
| 116 void Coalesce(const SyncSession& session); | 121 void Coalesce(const SyncSession& session); |
| 117 | 122 |
| 118 // Compares the routing_info_, workers and payload map with the passed in | 123 // Compares the routing_info_, workers and payload map with the passed in |
| 119 // session. Purges types from the above 3 which are not in session. Useful | 124 // session. Purges types from the above 3 which are not in session. Useful |
| 120 // to update the sync session when the user has disabled some types from | 125 // to update the sync session when the user has disabled some types from |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 | 202 |
| 198 private: | 203 private: |
| 199 SyncSession* session_; | 204 SyncSession* session_; |
| 200 DISALLOW_COPY_AND_ASSIGN(ScopedSetSessionWriteTransaction); | 205 DISALLOW_COPY_AND_ASSIGN(ScopedSetSessionWriteTransaction); |
| 201 }; | 206 }; |
| 202 | 207 |
| 203 } // namespace sessions | 208 } // namespace sessions |
| 204 } // namespace browser_sync | 209 } // namespace browser_sync |
| 205 | 210 |
| 206 #endif // CHROME_BROWSER_SYNC_SESSIONS_SYNC_SESSION_H_ | 211 #endif // CHROME_BROWSER_SYNC_SESSIONS_SYNC_SESSION_H_ |
| OLD | NEW |