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

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

Issue 10523003: Refactor following sync commit loop change (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Another rebase Created 8 years, 6 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 // StatusController handles all counter and status related number crunching and 5 // StatusController handles all counter and status related number crunching and
6 // state tracking on behalf of a SyncSession. It 'controls' the model data 6 // state tracking on behalf of a SyncSession. It 'controls' the model data
7 // defined in session_state.h. The most important feature of StatusController 7 // defined in session_state.h. The most important feature of StatusController
8 // is the ScopedModelSafetyRestriction. When one of these is active, the 8 // is the ScopedModelSafetyRestriction. When one of these is active, the
9 // underlying data set exposed via accessors is swapped out to the appropriate 9 // underlying data set exposed via accessors is swapped out to the appropriate
10 // set for the restricted ModelSafeGroup behind the scenes. For example, if 10 // set for the restricted ModelSafeGroup behind the scenes. For example, if
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 150
151 base::Time sync_start_time() const { 151 base::Time sync_start_time() const {
152 // The time at which we sent the first GetUpdates command for this sync. 152 // The time at which we sent the first GetUpdates command for this sync.
153 return sync_start_time_; 153 return sync_start_time_;
154 } 154 }
155 155
156 bool HasBookmarkCommitActivity() const { 156 bool HasBookmarkCommitActivity() const {
157 return ActiveGroupRestrictionIncludesModel(syncable::BOOKMARKS); 157 return ActiveGroupRestrictionIncludesModel(syncable::BOOKMARKS);
158 } 158 }
159 159
160 SyncerError last_post_commit_result() const;
161 SyncerError last_process_commit_response_result() const;
162
163 // A toolbelt full of methods for updating counters and flags. 160 // A toolbelt full of methods for updating counters and flags.
164 void set_num_server_changes_remaining(int64 changes_remaining); 161 void set_num_server_changes_remaining(int64 changes_remaining);
165 void set_invalid_store(bool invalid_store); 162 void set_invalid_store(bool invalid_store);
166 void set_num_successful_bookmark_commits(int value); 163 void set_num_successful_bookmark_commits(int value);
167 void increment_num_successful_commits(); 164 void increment_num_successful_commits();
168 void increment_num_successful_bookmark_commits(); 165 void increment_num_successful_bookmark_commits();
169 void increment_num_updates_downloaded_by(int value); 166 void increment_num_updates_downloaded_by(int value);
170 void increment_num_tombstone_updates_downloaded_by(int value); 167 void increment_num_tombstone_updates_downloaded_by(int value);
171 void increment_num_reflected_updates_downloaded_by(int value); 168 void increment_num_reflected_updates_downloaded_by(int value);
172 void set_types_needing_local_migration(syncable::ModelTypeSet types); 169 void set_types_needing_local_migration(syncable::ModelTypeSet types);
173 void increment_num_local_overwrites(); 170 void increment_num_local_overwrites();
174 void increment_num_server_overwrites(); 171 void increment_num_server_overwrites();
175 void set_sync_protocol_error(const SyncProtocolError& error); 172 void set_sync_protocol_error(const SyncProtocolError& error);
176 void set_last_download_updates_result(const SyncerError result); 173 void set_last_download_updates_result(const SyncerError result);
177 void set_last_post_commit_result(const SyncerError result); 174 void set_commit_result(const SyncerError result);
178 void set_last_process_commit_response_result(const SyncerError result);
179 175
180 void update_conflicts_resolved(bool resolved); 176 void update_conflicts_resolved(bool resolved);
181 void reset_conflicts_resolved(); 177 void reset_conflicts_resolved();
182 178
183 void UpdateStartTime(); 179 void UpdateStartTime();
184 180
185 void set_debug_info_sent(); 181 void set_debug_info_sent();
186 182
187 bool debug_info_sent() const; 183 bool debug_info_sent() const;
188 184
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 } 243 }
248 private: 244 private:
249 StatusController* status_; 245 StatusController* status_;
250 DISALLOW_COPY_AND_ASSIGN(ScopedModelSafeGroupRestriction); 246 DISALLOW_COPY_AND_ASSIGN(ScopedModelSafeGroupRestriction);
251 }; 247 };
252 248
253 } 249 }
254 } 250 }
255 251
256 #endif // SYNC_SESSIONS_STATUS_CONTROLLER_H_ 252 #endif // SYNC_SESSIONS_STATUS_CONTROLLER_H_
OLDNEW
« no previous file with comments | « sync/internal_api/public/sessions/sync_session_snapshot.h ('k') | sync/sessions/status_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698