| 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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 // Compares the routing_info_, workers and payload map with the passed in | 118 // 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 | 119 // 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 | 120 // to update the sync session when the user has disabled some types from |
| 121 // syncing. | 121 // syncing. |
| 122 void RebaseRoutingInfoWithLatest(SyncSession* session); | 122 void RebaseRoutingInfoWithLatest(SyncSession* session); |
| 123 | 123 |
| 124 // Should be called any time |this| is being re-used in a new call to | 124 // Should be called any time |this| is being re-used in a new call to |
| 125 // SyncShare (e.g., HasMoreToSync returned true). | 125 // SyncShare (e.g., HasMoreToSync returned true). |
| 126 void ResetTransientState(); | 126 void ResetTransientState(); |
| 127 | 127 |
| 128 // TODO(akalin): Split this into context() and mutable_context(). |
| 128 SyncSessionContext* context() const { return context_; } | 129 SyncSessionContext* context() const { return context_; } |
| 129 Delegate* delegate() const { return delegate_; } | 130 Delegate* delegate() const { return delegate_; } |
| 130 syncable::WriteTransaction* write_transaction() { return write_transaction_; } | 131 syncable::WriteTransaction* write_transaction() { return write_transaction_; } |
| 131 StatusController* status_controller() { return status_controller_.get(); } | 132 const StatusController& status_controller() const { |
| 133 return *status_controller_.get(); |
| 134 } |
| 135 StatusController* mutable_status_controller() { |
| 136 return status_controller_.get(); |
| 137 } |
| 132 | 138 |
| 133 const ExtensionsActivityMonitor::Records& extensions_activity() const { | 139 const ExtensionsActivityMonitor::Records& extensions_activity() const { |
| 134 return extensions_activity_; | 140 return extensions_activity_; |
| 135 } | 141 } |
| 136 ExtensionsActivityMonitor::Records* mutable_extensions_activity() { | 142 ExtensionsActivityMonitor::Records* mutable_extensions_activity() { |
| 137 return &extensions_activity_; | 143 return &extensions_activity_; |
| 138 } | 144 } |
| 139 | 145 |
| 140 // Volatile reader for the source member of the sync session object. The | 146 // Volatile reader for the source member of the sync session object. The |
| 141 // value is set to the SYNC_CYCLE_CONTINUATION value to signal that it has | 147 // value is set to the SYNC_CYCLE_CONTINUATION value to signal that it has |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 | 203 |
| 198 private: | 204 private: |
| 199 SyncSession* session_; | 205 SyncSession* session_; |
| 200 DISALLOW_COPY_AND_ASSIGN(ScopedSetSessionWriteTransaction); | 206 DISALLOW_COPY_AND_ASSIGN(ScopedSetSessionWriteTransaction); |
| 201 }; | 207 }; |
| 202 | 208 |
| 203 } // namespace sessions | 209 } // namespace sessions |
| 204 } // namespace browser_sync | 210 } // namespace browser_sync |
| 205 | 211 |
| 206 #endif // CHROME_BROWSER_SYNC_SESSIONS_SYNC_SESSION_H_ | 212 #endif // CHROME_BROWSER_SYNC_SESSIONS_SYNC_SESSION_H_ |
| OLD | NEW |