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 | |
195 ModelSafeGroup group_restriction() const { | 192 ModelSafeGroup group_restriction() const { |
196 return group_restriction_; | 193 return group_restriction_; |
197 } | 194 } |
198 | 195 |
199 base::Time sync_start_time() const { | 196 base::Time sync_start_time() const { |
200 // The time at which we sent the first GetUpdates command for this sync. | 197 // The time at which we sent the first GetUpdates command for this sync. |
201 return sync_start_time_; | 198 return sync_start_time_; |
202 } | 199 } |
203 | 200 |
204 // Check whether a particular model is included by the active group | 201 // Check whether a particular model is included by the active group |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 } | 293 } |
297 private: | 294 private: |
298 StatusController* status_; | 295 StatusController* status_; |
299 DISALLOW_COPY_AND_ASSIGN(ScopedModelSafeGroupRestriction); | 296 DISALLOW_COPY_AND_ASSIGN(ScopedModelSafeGroupRestriction); |
300 }; | 297 }; |
301 | 298 |
302 } | 299 } |
303 } | 300 } |
304 | 301 |
305 #endif // CHROME_BROWSER_SYNC_SESSIONS_STATUS_CONTROLLER_H_ | 302 #endif // CHROME_BROWSER_SYNC_SESSIONS_STATUS_CONTROLLER_H_ |
OLD | NEW |