Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Side by Side Diff: sync/sessions/sync_session.h

Issue 10909160: sync: Process client commands on commit response (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Minor formatting improvement Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 // Compares the routing_info_, workers and payload map with the passed in 142 // Compares the routing_info_, workers and payload map with the passed in
143 // session. Purges types from the above 3 which are not in session. Useful 143 // session. Purges types from the above 3 which are not in session. Useful
144 // to update the sync session when the user has disabled some types from 144 // to update the sync session when the user has disabled some types from
145 // syncing. 145 // syncing.
146 void RebaseRoutingInfoWithLatest(const SyncSession& session); 146 void RebaseRoutingInfoWithLatest(const SyncSession& session);
147 147
148 // Should be called any time |this| is being re-used in a new call to 148 // Should be called any time |this| is being re-used in a new call to
149 // SyncShare (e.g., HasMoreToSync returned true). 149 // SyncShare (e.g., HasMoreToSync returned true).
150 void PrepareForAnotherSyncCycle(); 150 void PrepareForAnotherSyncCycle();
151 151
152 // Sets various configuration settings based on orders from the server.
153 void ProcessClientCommand(const sync_pb::ClientCommand& command);
154
152 // TODO(akalin): Split this into context() and mutable_context(). 155 // TODO(akalin): Split this into context() and mutable_context().
153 SyncSessionContext* context() const { return context_; } 156 SyncSessionContext* context() const { return context_; }
154 Delegate* delegate() const { return delegate_; } 157 Delegate* delegate() const { return delegate_; }
155 syncable::WriteTransaction* write_transaction() { return write_transaction_; } 158 syncable::WriteTransaction* write_transaction() { return write_transaction_; }
156 const StatusController& status_controller() const { 159 const StatusController& status_controller() const {
157 return *status_controller_.get(); 160 return *status_controller_.get();
158 } 161 }
159 StatusController* mutable_status_controller() { 162 StatusController* mutable_status_controller() {
160 return status_controller_.get(); 163 return status_controller_.get();
161 } 164 }
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 245
243 private: 246 private:
244 SyncSession* session_; 247 SyncSession* session_;
245 DISALLOW_COPY_AND_ASSIGN(ScopedSetSessionWriteTransaction); 248 DISALLOW_COPY_AND_ASSIGN(ScopedSetSessionWriteTransaction);
246 }; 249 };
247 250
248 } // namespace sessions 251 } // namespace sessions
249 } // namespace syncer 252 } // namespace syncer
250 253
251 #endif // SYNC_SESSIONS_SYNC_SESSION_H_ 254 #endif // SYNC_SESSIONS_SYNC_SESSION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698