OLD | NEW |
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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 } | 142 } |
143 | 143 |
144 bool HasBookmarkCommitActivity() const { | 144 bool HasBookmarkCommitActivity() const { |
145 return ActiveGroupRestrictionIncludesModel(BOOKMARKS); | 145 return ActiveGroupRestrictionIncludesModel(BOOKMARKS); |
146 } | 146 } |
147 | 147 |
148 const ModelNeutralState& model_neutral_state() const { | 148 const ModelNeutralState& model_neutral_state() const { |
149 return model_neutral_; | 149 return model_neutral_; |
150 } | 150 } |
151 | 151 |
| 152 SyncerError last_get_key_result() const; |
| 153 |
152 // A toolbelt full of methods for updating counters and flags. | 154 // A toolbelt full of methods for updating counters and flags. |
153 void set_num_server_changes_remaining(int64 changes_remaining); | 155 void set_num_server_changes_remaining(int64 changes_remaining); |
154 void set_num_successful_bookmark_commits(int value); | 156 void set_num_successful_bookmark_commits(int value); |
155 void increment_num_successful_commits(); | 157 void increment_num_successful_commits(); |
156 void increment_num_successful_bookmark_commits(); | 158 void increment_num_successful_bookmark_commits(); |
157 void increment_num_updates_downloaded_by(int value); | 159 void increment_num_updates_downloaded_by(int value); |
158 void increment_num_tombstone_updates_downloaded_by(int value); | 160 void increment_num_tombstone_updates_downloaded_by(int value); |
159 void increment_num_reflected_updates_downloaded_by(int value); | 161 void increment_num_reflected_updates_downloaded_by(int value); |
160 void set_types_needing_local_migration(ModelTypeSet types); | 162 void set_types_needing_local_migration(ModelTypeSet types); |
161 void increment_num_local_overwrites(); | 163 void increment_num_local_overwrites(); |
162 void increment_num_server_overwrites(); | 164 void increment_num_server_overwrites(); |
163 void set_sync_protocol_error(const SyncProtocolError& error); | 165 void set_sync_protocol_error(const SyncProtocolError& error); |
| 166 void set_last_get_key_result(const SyncerError result); |
164 void set_last_download_updates_result(const SyncerError result); | 167 void set_last_download_updates_result(const SyncerError result); |
165 void set_commit_result(const SyncerError result); | 168 void set_commit_result(const SyncerError result); |
166 | 169 |
167 void update_conflicts_resolved(bool resolved); | 170 void update_conflicts_resolved(bool resolved); |
168 void reset_conflicts_resolved(); | 171 void reset_conflicts_resolved(); |
169 | 172 |
170 void UpdateStartTime(); | 173 void UpdateStartTime(); |
171 | 174 |
172 void set_debug_info_sent(); | 175 void set_debug_info_sent(); |
173 | 176 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 } | 233 } |
231 private: | 234 private: |
232 StatusController* status_; | 235 StatusController* status_; |
233 DISALLOW_COPY_AND_ASSIGN(ScopedModelSafeGroupRestriction); | 236 DISALLOW_COPY_AND_ASSIGN(ScopedModelSafeGroupRestriction); |
234 }; | 237 }; |
235 | 238 |
236 } // namespace sessions | 239 } // namespace sessions |
237 } // namespace syncer | 240 } // namespace syncer |
238 | 241 |
239 #endif // SYNC_SESSIONS_STATUS_CONTROLLER_H_ | 242 #endif // SYNC_SESSIONS_STATUS_CONTROLLER_H_ |
OLD | NEW |