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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 DCHECK(!group_restriction_in_effect_) << "Group restriction in effect!"; | 131 DCHECK(!group_restriction_in_effect_) << "Group restriction in effect!"; |
132 return shared_.commit_set.GetModelTypeAt(index); | 132 return shared_.commit_set.GetModelTypeAt(index); |
133 } | 133 } |
134 const std::vector<int64>& unsynced_handles() const { | 134 const std::vector<int64>& unsynced_handles() const { |
135 DCHECK(!group_restriction_in_effect_) | 135 DCHECK(!group_restriction_in_effect_) |
136 << "unsynced_handles is unrestricted."; | 136 << "unsynced_handles is unrestricted."; |
137 return shared_.unsynced_handles.value(); | 137 return shared_.unsynced_handles.value(); |
138 } | 138 } |
139 | 139 |
140 // Control parameters for sync cycles. | 140 // Control parameters for sync cycles. |
141 bool conflict_sets_built() const { | |
142 return shared_.control_params.conflict_sets_built; | |
143 } | |
144 bool conflicts_resolved() const { | 141 bool conflicts_resolved() const { |
145 return shared_.control_params.conflicts_resolved; | 142 return shared_.control_params.conflicts_resolved; |
146 } | 143 } |
147 bool did_commit_items() const { | 144 bool did_commit_items() const { |
148 return shared_.control_params.items_committed; | 145 return shared_.control_params.items_committed; |
149 } | 146 } |
150 | 147 |
151 // If a GetUpdates for any data type resulted in downloading an update that | 148 // If a GetUpdates for any data type resulted in downloading an update that |
152 // is in conflict, this method returns true. | 149 // is in conflict, this method returns true. |
153 // Note: this includes non-blocking conflicts. | 150 // Note: this includes non-blocking conflicts. |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 void set_types_needing_local_migration(syncable::ModelTypeSet types); | 222 void set_types_needing_local_migration(syncable::ModelTypeSet types); |
226 void set_unsynced_handles(const std::vector<int64>& unsynced_handles); | 223 void set_unsynced_handles(const std::vector<int64>& unsynced_handles); |
227 void increment_num_local_overwrites(); | 224 void increment_num_local_overwrites(); |
228 void increment_num_server_overwrites(); | 225 void increment_num_server_overwrites(); |
229 void set_sync_protocol_error(const SyncProtocolError& error); | 226 void set_sync_protocol_error(const SyncProtocolError& error); |
230 void set_last_download_updates_result(const SyncerError result); | 227 void set_last_download_updates_result(const SyncerError result); |
231 void set_last_post_commit_result(const SyncerError result); | 228 void set_last_post_commit_result(const SyncerError result); |
232 void set_last_process_commit_response_result(const SyncerError result); | 229 void set_last_process_commit_response_result(const SyncerError result); |
233 | 230 |
234 void set_commit_set(const OrderedCommitSet& commit_set); | 231 void set_commit_set(const OrderedCommitSet& commit_set); |
235 void update_conflict_sets_built(bool built); | |
236 void update_conflicts_resolved(bool resolved); | 232 void update_conflicts_resolved(bool resolved); |
237 void reset_conflicts_resolved(); | 233 void reset_conflicts_resolved(); |
238 void set_items_committed(); | 234 void set_items_committed(); |
239 | 235 |
240 void UpdateStartTime(); | 236 void UpdateStartTime(); |
241 | 237 |
242 void set_debug_info_sent(); | 238 void set_debug_info_sent(); |
243 | 239 |
244 bool debug_info_sent() const; | 240 bool debug_info_sent() const; |
245 | 241 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 } | 293 } |
298 private: | 294 private: |
299 StatusController* status_; | 295 StatusController* status_; |
300 DISALLOW_COPY_AND_ASSIGN(ScopedModelSafeGroupRestriction); | 296 DISALLOW_COPY_AND_ASSIGN(ScopedModelSafeGroupRestriction); |
301 }; | 297 }; |
302 | 298 |
303 } | 299 } |
304 } | 300 } |
305 | 301 |
306 #endif // CHROME_BROWSER_SYNC_SESSIONS_STATUS_CONTROLLER_H_ | 302 #endif // CHROME_BROWSER_SYNC_SESSIONS_STATUS_CONTROLLER_H_ |
OLD | NEW |