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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 } | 182 } |
183 | 183 |
184 // Returns true if the last updates response indicated that we were fully | 184 // Returns true if the last updates response indicated that we were fully |
185 // up to date. This is subtle: if it's false, it could either mean that | 185 // up to date. This is subtle: if it's false, it could either mean that |
186 // the server said there WAS more to download, or it could mean that we | 186 // the server said there WAS more to download, or it could mean that we |
187 // were unable to reach the server. If we didn't request every enabled | 187 // were unable to reach the server. If we didn't request every enabled |
188 // datatype, then we can't say for sure that there's nothing left to | 188 // datatype, then we can't say for sure that there's nothing left to |
189 // download: in that case, this also returns false. | 189 // download: in that case, this also returns false. |
190 bool ServerSaysNothingMoreToDownload() const; | 190 bool ServerSaysNothingMoreToDownload() const; |
191 | 191 |
| 192 // Returns true if there are updates to be processed. |
| 193 bool ResponseContainsUpdates() const; |
| 194 |
192 ModelSafeGroup group_restriction() const { | 195 ModelSafeGroup group_restriction() const { |
193 return group_restriction_; | 196 return group_restriction_; |
194 } | 197 } |
195 | 198 |
196 base::Time sync_start_time() const { | 199 base::Time sync_start_time() const { |
197 // The time at which we sent the first GetUpdates command for this sync. | 200 // The time at which we sent the first GetUpdates command for this sync. |
198 return sync_start_time_; | 201 return sync_start_time_; |
199 } | 202 } |
200 | 203 |
201 // Check whether a particular model is included by the active group | 204 // Check whether a particular model is included by the active group |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 } | 296 } |
294 private: | 297 private: |
295 StatusController* status_; | 298 StatusController* status_; |
296 DISALLOW_COPY_AND_ASSIGN(ScopedModelSafeGroupRestriction); | 299 DISALLOW_COPY_AND_ASSIGN(ScopedModelSafeGroupRestriction); |
297 }; | 300 }; |
298 | 301 |
299 } | 302 } |
300 } | 303 } |
301 | 304 |
302 #endif // CHROME_BROWSER_SYNC_SESSIONS_STATUS_CONTROLLER_H_ | 305 #endif // CHROME_BROWSER_SYNC_SESSIONS_STATUS_CONTROLLER_H_ |
OLD | NEW |