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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 } | 76 } |
77 ClientToServerMessage* mutable_commit_message() { | 77 ClientToServerMessage* mutable_commit_message() { |
78 return &shared_.commit_message; | 78 return &shared_.commit_message; |
79 } | 79 } |
80 const ClientToServerResponse& commit_response() const { | 80 const ClientToServerResponse& commit_response() const { |
81 return shared_.commit_response; | 81 return shared_.commit_response; |
82 } | 82 } |
83 ClientToServerResponse* mutable_commit_response() { | 83 ClientToServerResponse* mutable_commit_response() { |
84 return &shared_.commit_response; | 84 return &shared_.commit_response; |
85 } | 85 } |
86 const syncable::ModelEnumSet updates_request_types() const { | 86 const syncable::ModelTypeSet updates_request_types() const { |
87 return shared_.updates_request_types; | 87 return shared_.updates_request_types; |
88 } | 88 } |
89 void set_updates_request_types(syncable::ModelEnumSet value) { | 89 void set_updates_request_types(syncable::ModelTypeSet value) { |
90 shared_.updates_request_types = value; | 90 shared_.updates_request_types = value; |
91 } | 91 } |
92 const ClientToServerResponse& updates_response() const { | 92 const ClientToServerResponse& updates_response() const { |
93 return shared_.updates_response; | 93 return shared_.updates_response; |
94 } | 94 } |
95 ClientToServerResponse* mutable_updates_response() { | 95 ClientToServerResponse* mutable_updates_response() { |
96 return &shared_.updates_response; | 96 return &shared_.updates_response; |
97 } | 97 } |
98 | 98 |
99 // Errors and SyncerStatus. | 99 // Errors and SyncerStatus. |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 void increment_num_consecutive_errors(); | 216 void increment_num_consecutive_errors(); |
217 void increment_num_consecutive_errors_by(int value); | 217 void increment_num_consecutive_errors_by(int value); |
218 void set_num_server_changes_remaining(int64 changes_remaining); | 218 void set_num_server_changes_remaining(int64 changes_remaining); |
219 void set_invalid_store(bool invalid_store); | 219 void set_invalid_store(bool invalid_store); |
220 void set_syncer_stuck(bool syncer_stuck); | 220 void set_syncer_stuck(bool syncer_stuck); |
221 void set_num_successful_bookmark_commits(int value); | 221 void set_num_successful_bookmark_commits(int value); |
222 void increment_num_successful_commits(); | 222 void increment_num_successful_commits(); |
223 void increment_num_successful_bookmark_commits(); | 223 void increment_num_successful_bookmark_commits(); |
224 void increment_num_updates_downloaded_by(int value); | 224 void increment_num_updates_downloaded_by(int value); |
225 void increment_num_tombstone_updates_downloaded_by(int value); | 225 void increment_num_tombstone_updates_downloaded_by(int value); |
226 void set_types_needing_local_migration(syncable::ModelEnumSet types); | 226 void set_types_needing_local_migration(syncable::ModelTypeSet types); |
227 void set_unsynced_handles(const std::vector<int64>& unsynced_handles); | 227 void set_unsynced_handles(const std::vector<int64>& unsynced_handles); |
228 void increment_num_local_overwrites(); | 228 void increment_num_local_overwrites(); |
229 void increment_num_server_overwrites(); | 229 void increment_num_server_overwrites(); |
230 void set_sync_protocol_error(const SyncProtocolError& error); | 230 void set_sync_protocol_error(const SyncProtocolError& error); |
231 | 231 |
232 void set_commit_set(const OrderedCommitSet& commit_set); | 232 void set_commit_set(const OrderedCommitSet& commit_set); |
233 void update_conflict_sets_built(bool built); | 233 void update_conflict_sets_built(bool built); |
234 void update_conflicts_resolved(bool resolved); | 234 void update_conflicts_resolved(bool resolved); |
235 void reset_conflicts_resolved(); | 235 void reset_conflicts_resolved(); |
236 void set_items_committed(); | 236 void set_items_committed(); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 } | 295 } |
296 private: | 296 private: |
297 StatusController* status_; | 297 StatusController* status_; |
298 DISALLOW_COPY_AND_ASSIGN(ScopedModelSafeGroupRestriction); | 298 DISALLOW_COPY_AND_ASSIGN(ScopedModelSafeGroupRestriction); |
299 }; | 299 }; |
300 | 300 |
301 } | 301 } |
302 } | 302 } |
303 | 303 |
304 #endif // CHROME_BROWSER_SYNC_SESSIONS_STATUS_CONTROLLER_H_ | 304 #endif // CHROME_BROWSER_SYNC_SESSIONS_STATUS_CONTROLLER_H_ |
OLD | NEW |