| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 return &GetOrCreateModelSafeGroupState(true, | 66 return &GetOrCreateModelSafeGroupState(true, |
| 67 group_restriction_)->update_progress; | 67 group_restriction_)->update_progress; |
| 68 } | 68 } |
| 69 // Some unrestricted, non-ModelChangingSyncerCommand commands need to store | 69 // Some unrestricted, non-ModelChangingSyncerCommand commands need to store |
| 70 // meta information about updates. | 70 // meta information about updates. |
| 71 UpdateProgress* GetUnrestrictedUpdateProgress(ModelSafeGroup group) { | 71 UpdateProgress* GetUnrestrictedUpdateProgress(ModelSafeGroup group) { |
| 72 return &GetOrCreateModelSafeGroupState(false, group)->update_progress; | 72 return &GetOrCreateModelSafeGroupState(false, group)->update_progress; |
| 73 } | 73 } |
| 74 | 74 |
| 75 // ClientToServer messages. | 75 // ClientToServer messages. |
| 76 const ClientToServerMessage& commit_message() { |
| 77 return shared_.commit_message; |
| 78 } |
| 76 ClientToServerMessage* mutable_commit_message() { | 79 ClientToServerMessage* mutable_commit_message() { |
| 77 return &shared_.commit_message; | 80 return &shared_.commit_message; |
| 78 } | 81 } |
| 79 const ClientToServerResponse& commit_response() const { | 82 const ClientToServerResponse& commit_response() const { |
| 80 return shared_.commit_response; | 83 return shared_.commit_response; |
| 81 } | 84 } |
| 82 ClientToServerResponse* mutable_commit_response() { | 85 ClientToServerResponse* mutable_commit_response() { |
| 83 return &shared_.commit_response; | 86 return &shared_.commit_response; |
| 84 } | 87 } |
| 85 const syncable::MultiTypeTimeStamp& updates_request_parameters() const { | 88 const syncable::MultiTypeTimeStamp& updates_request_parameters() const { |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 } | 276 } |
| 274 private: | 277 private: |
| 275 StatusController* status_; | 278 StatusController* status_; |
| 276 DISALLOW_COPY_AND_ASSIGN(ScopedModelSafeGroupRestriction); | 279 DISALLOW_COPY_AND_ASSIGN(ScopedModelSafeGroupRestriction); |
| 277 }; | 280 }; |
| 278 | 281 |
| 279 } | 282 } |
| 280 } | 283 } |
| 281 | 284 |
| 282 #endif // CHROME_BROWSER_SYNC_SESSIONS_STATUS_CONTROLLER_H_ | 285 #endif // CHROME_BROWSER_SYNC_SESSIONS_STATUS_CONTROLLER_H_ |
| OLD | NEW |