| 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 shared_.updates_request_types = value; | 96 shared_.updates_request_types = value; |
| 97 } | 97 } |
| 98 const ClientToServerResponse& updates_response() const { | 98 const ClientToServerResponse& updates_response() const { |
| 99 return shared_.updates_response; | 99 return shared_.updates_response; |
| 100 } | 100 } |
| 101 ClientToServerResponse* mutable_updates_response() { | 101 ClientToServerResponse* mutable_updates_response() { |
| 102 return &shared_.updates_response; | 102 return &shared_.updates_response; |
| 103 } | 103 } |
| 104 | 104 |
| 105 // Errors and SyncerStatus. | 105 // Errors and SyncerStatus. |
| 106 const ErrorCounters& error_counters() const { | 106 const ErrorCounters& error() const { |
| 107 return shared_.error_counters.value(); | 107 return shared_.error.value(); |
| 108 } | 108 } |
| 109 const SyncerStatus& syncer_status() const { | 109 const SyncerStatus& syncer_status() const { |
| 110 return shared_.syncer_status.value(); | 110 return shared_.syncer_status.value(); |
| 111 } | 111 } |
| 112 | 112 |
| 113 // Changelog related state. | 113 // Changelog related state. |
| 114 int64 num_server_changes_remaining() const { | 114 int64 num_server_changes_remaining() const { |
| 115 return shared_.num_server_changes_remaining.value(); | 115 return shared_.num_server_changes_remaining.value(); |
| 116 } | 116 } |
| 117 | 117 |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 void set_syncer_stuck(bool syncer_stuck); | 222 void set_syncer_stuck(bool syncer_stuck); |
| 223 void set_num_successful_bookmark_commits(int value); | 223 void set_num_successful_bookmark_commits(int value); |
| 224 void increment_num_successful_commits(); | 224 void increment_num_successful_commits(); |
| 225 void increment_num_successful_bookmark_commits(); | 225 void increment_num_successful_bookmark_commits(); |
| 226 void increment_num_updates_downloaded_by(int value); | 226 void increment_num_updates_downloaded_by(int value); |
| 227 void increment_num_tombstone_updates_downloaded_by(int value); | 227 void increment_num_tombstone_updates_downloaded_by(int value); |
| 228 void set_types_needing_local_migration(const syncable::ModelTypeSet& types); | 228 void set_types_needing_local_migration(const syncable::ModelTypeSet& types); |
| 229 void set_unsynced_handles(const std::vector<int64>& unsynced_handles); | 229 void set_unsynced_handles(const std::vector<int64>& unsynced_handles); |
| 230 void increment_num_local_overwrites(); | 230 void increment_num_local_overwrites(); |
| 231 void increment_num_server_overwrites(); | 231 void increment_num_server_overwrites(); |
| 232 void set_sync_protocol_error(const SyncProtocolError& error); |
| 232 | 233 |
| 233 void set_commit_set(const OrderedCommitSet& commit_set); | 234 void set_commit_set(const OrderedCommitSet& commit_set); |
| 234 void update_conflict_sets_built(bool built); | 235 void update_conflict_sets_built(bool built); |
| 235 void update_conflicts_resolved(bool resolved); | 236 void update_conflicts_resolved(bool resolved); |
| 236 void reset_conflicts_resolved(); | 237 void reset_conflicts_resolved(); |
| 237 void set_items_committed(); | 238 void set_items_committed(); |
| 238 | 239 |
| 239 void SetSyncInProgressAndUpdateStartTime(bool sync_in_progress); | 240 void SetSyncInProgressAndUpdateStartTime(bool sync_in_progress); |
| 240 | 241 |
| 241 private: | 242 private: |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 } | 289 } |
| 289 private: | 290 private: |
| 290 StatusController* status_; | 291 StatusController* status_; |
| 291 DISALLOW_COPY_AND_ASSIGN(ScopedModelSafeGroupRestriction); | 292 DISALLOW_COPY_AND_ASSIGN(ScopedModelSafeGroupRestriction); |
| 292 }; | 293 }; |
| 293 | 294 |
| 294 } | 295 } |
| 295 } | 296 } |
| 296 | 297 |
| 297 #endif // CHROME_BROWSER_SYNC_SESSIONS_STATUS_CONTROLLER_H_ | 298 #endif // CHROME_BROWSER_SYNC_SESSIONS_STATUS_CONTROLLER_H_ |
| OLD | NEW |