Chromium Code Reviews| 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 105 // Builds a thread-safe and read-only copy of the current session state. | 105 // Builds a thread-safe and read-only copy of the current session state. |
| 106 SyncSessionSnapshot TakeSnapshot() const; | 106 SyncSessionSnapshot TakeSnapshot() const; |
| 107 | 107 |
| 108 // Builds and sends a snapshot to the session context's listeners. | 108 // Builds and sends a snapshot to the session context's listeners. |
| 109 void SendEventNotification(SyncEngineEvent::EventCause cause); | 109 void SendEventNotification(SyncEngineEvent::EventCause cause); |
| 110 | 110 |
| 111 // Returns true if this session contains data that should go through the sync | 111 // Returns true if this session contains data that should go through the sync |
| 112 // engine again. | 112 // engine again. |
| 113 bool HasMoreToSync() const; | 113 bool HasMoreToSync() const; |
| 114 | 114 |
| 115 // Returns true if this session completed without experiencing any sort of | |
| 116 // errors. | |
|
tim (not reviewing)
2012/01/10 17:17:34
"any sort of errors" is pretty vague. I know we c
rlarocque
2012/01/10 20:40:56
All successes look alike, but there are many kinds
| |
| 117 // | |
| 118 // Returns false if SyncShare has not been called on this session yet, or | |
| 119 // if ResetTransientState() has been called on this session since the last | |
| 120 // call to SyncShare. | |
| 121 bool Succeeded() const; | |
| 122 | |
| 115 // Collects all state pertaining to how and why |s| originated and unions it | 123 // Collects all state pertaining to how and why |s| originated and unions it |
| 116 // with corresponding state in |this|, leaving |s| unchanged. Allows |this| | 124 // with corresponding state in |this|, leaving |s| unchanged. Allows |this| |
| 117 // to take on the responsibilities |s| had (e.g. certain data types) in the | 125 // to take on the responsibilities |s| had (e.g. certain data types) in the |
| 118 // next SyncShare operation using |this|, rather than needed two separate | 126 // next SyncShare operation using |this|, rather than needed two separate |
| 119 // sessions. | 127 // sessions. |
| 120 void Coalesce(const SyncSession& session); | 128 void Coalesce(const SyncSession& session); |
| 121 | 129 |
| 122 // Compares the routing_info_, workers and payload map with the passed in | 130 // Compares the routing_info_, workers and payload map with the passed in |
| 123 // session. Purges types from the above 3 which are not in session. Useful | 131 // session. Purges types from the above 3 which are not in session. Useful |
| 124 // to update the sync session when the user has disabled some types from | 132 // to update the sync session when the user has disabled some types from |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 220 | 228 |
| 221 private: | 229 private: |
| 222 SyncSession* session_; | 230 SyncSession* session_; |
| 223 DISALLOW_COPY_AND_ASSIGN(ScopedSetSessionWriteTransaction); | 231 DISALLOW_COPY_AND_ASSIGN(ScopedSetSessionWriteTransaction); |
| 224 }; | 232 }; |
| 225 | 233 |
| 226 } // namespace sessions | 234 } // namespace sessions |
| 227 } // namespace browser_sync | 235 } // namespace browser_sync |
| 228 | 236 |
| 229 #endif // CHROME_BROWSER_SYNC_SESSIONS_SYNC_SESSION_H_ | 237 #endif // CHROME_BROWSER_SYNC_SESSIONS_SYNC_SESSION_H_ |
| OLD | NEW |