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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 int num_server_conflicts() const; | 100 int num_server_conflicts() const; |
101 | 101 |
102 int num_simple_conflicts() const; | 102 int num_simple_conflicts() const; |
103 | 103 |
104 // Aggregate sum of all conflicting items over all conflict types. | 104 // Aggregate sum of all conflicting items over all conflict types. |
105 int TotalNumConflictingItems() const; | 105 int TotalNumConflictingItems() const; |
106 | 106 |
107 // Number of successfully applied updates. | 107 // Number of successfully applied updates. |
108 int num_updates_applied() const; | 108 int num_updates_applied() const; |
109 | 109 |
| 110 int num_server_overwrites() const; |
| 111 |
110 // Returns the number of updates received from the sync server. | 112 // Returns the number of updates received from the sync server. |
111 int64 CountUpdates() const; | 113 int64 CountUpdates() const; |
112 | 114 |
113 // Returns true if the last download_updates_command received a valid | 115 // Returns true if the last download_updates_command received a valid |
114 // server response. | 116 // server response. |
115 bool download_updates_succeeded() const { | 117 bool download_updates_succeeded() const { |
116 return model_neutral_.last_download_updates_result | 118 return model_neutral_.last_download_updates_result |
117 == SYNCER_OK; | 119 == SYNCER_OK; |
118 } | 120 } |
119 | 121 |
(...skipping 24 matching lines...) Expand all Loading... |
144 | 146 |
145 SyncerError last_get_key_result() const; | 147 SyncerError last_get_key_result() const; |
146 | 148 |
147 // Download counters. | 149 // Download counters. |
148 void set_num_server_changes_remaining(int64 changes_remaining); | 150 void set_num_server_changes_remaining(int64 changes_remaining); |
149 void increment_num_updates_downloaded_by(int value); | 151 void increment_num_updates_downloaded_by(int value); |
150 void increment_num_tombstone_updates_downloaded_by(int value); | 152 void increment_num_tombstone_updates_downloaded_by(int value); |
151 void increment_num_reflected_updates_downloaded_by(int value); | 153 void increment_num_reflected_updates_downloaded_by(int value); |
152 | 154 |
153 // Update application and conflict resolution counters. | 155 // Update application and conflict resolution counters. |
154 void increment_num_updates_applied(); | 156 void increment_num_updates_applied_by(int value); |
155 void increment_num_encryption_conflicts(); | 157 void increment_num_encryption_conflicts_by(int value); |
| 158 void increment_num_hierarchy_conflicts_by(int value); |
156 void increment_num_server_conflicts(); | 159 void increment_num_server_conflicts(); |
157 void set_num_hierarchy_conflicts(int value); | |
158 void increment_num_local_overwrites(); | 160 void increment_num_local_overwrites(); |
159 void increment_num_server_overwrites(); | 161 void increment_num_server_overwrites(); |
160 | 162 |
161 // TODO(rlarocque): Remove these after conflict resolution refactor. | 163 // TODO(rlarocque): Remove these after conflict resolution refactor. |
162 void update_conflicts_resolved(bool resolved); | 164 void update_conflicts_resolved(bool resolved); |
163 void reset_conflicts_resolved(); | 165 void reset_conflicts_resolved(); |
164 | 166 |
165 // Commit counters. | 167 // Commit counters. |
166 void increment_num_successful_commits(); | 168 void increment_num_successful_commits(); |
167 void increment_num_successful_bookmark_commits(); | 169 void increment_num_successful_bookmark_commits(); |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 } | 241 } |
240 private: | 242 private: |
241 StatusController* status_; | 243 StatusController* status_; |
242 DISALLOW_COPY_AND_ASSIGN(ScopedModelSafeGroupRestriction); | 244 DISALLOW_COPY_AND_ASSIGN(ScopedModelSafeGroupRestriction); |
243 }; | 245 }; |
244 | 246 |
245 } // namespace sessions | 247 } // namespace sessions |
246 } // namespace syncer | 248 } // namespace syncer |
247 | 249 |
248 #endif // SYNC_SESSIONS_STATUS_CONTROLLER_H_ | 250 #endif // SYNC_SESSIONS_STATUS_CONTROLLER_H_ |
OLD | NEW |