| 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 // 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 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 void set_sync_protocol_error(const SyncProtocolError& error); | 232 void set_sync_protocol_error(const SyncProtocolError& error); |
| 233 | 233 |
| 234 void set_commit_set(const OrderedCommitSet& commit_set); | 234 void set_commit_set(const OrderedCommitSet& commit_set); |
| 235 void update_conflict_sets_built(bool built); | 235 void update_conflict_sets_built(bool built); |
| 236 void update_conflicts_resolved(bool resolved); | 236 void update_conflicts_resolved(bool resolved); |
| 237 void reset_conflicts_resolved(); | 237 void reset_conflicts_resolved(); |
| 238 void set_items_committed(); | 238 void set_items_committed(); |
| 239 | 239 |
| 240 void SetSyncInProgressAndUpdateStartTime(bool sync_in_progress); | 240 void SetSyncInProgressAndUpdateStartTime(bool sync_in_progress); |
| 241 | 241 |
| 242 void set_debug_info_sent(); | |
| 243 | |
| 244 bool debug_info_sent(); | |
| 245 | |
| 246 private: | 242 private: |
| 247 friend class ScopedModelSafeGroupRestriction; | 243 friend class ScopedModelSafeGroupRestriction; |
| 248 | 244 |
| 249 // Returns true iff the commit id projection for |group_restriction_| | 245 // Returns true iff the commit id projection for |group_restriction_| |
| 250 // references position |index| into the full set of commit ids in play. | 246 // references position |index| into the full set of commit ids in play. |
| 251 bool CurrentCommitIdProjectionHasIndex(size_t index); | 247 bool CurrentCommitIdProjectionHasIndex(size_t index); |
| 252 | 248 |
| 253 // Helper to lazily create objects for per-ModelSafeGroup state. | 249 // Helper to lazily create objects for per-ModelSafeGroup state. |
| 254 PerModelSafeGroupState* GetOrCreateModelSafeGroupState(bool restrict, | 250 PerModelSafeGroupState* GetOrCreateModelSafeGroupState(bool restrict, |
| 255 ModelSafeGroup group); | 251 ModelSafeGroup group); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 } | 289 } |
| 294 private: | 290 private: |
| 295 StatusController* status_; | 291 StatusController* status_; |
| 296 DISALLOW_COPY_AND_ASSIGN(ScopedModelSafeGroupRestriction); | 292 DISALLOW_COPY_AND_ASSIGN(ScopedModelSafeGroupRestriction); |
| 297 }; | 293 }; |
| 298 | 294 |
| 299 } | 295 } |
| 300 } | 296 } |
| 301 | 297 |
| 302 #endif // CHROME_BROWSER_SYNC_SESSIONS_STATUS_CONTROLLER_H_ | 298 #endif // CHROME_BROWSER_SYNC_SESSIONS_STATUS_CONTROLLER_H_ |
| OLD | NEW |