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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 UpdateProgress* GetUnrestrictedMutableUpdateProgressForTest( | 66 UpdateProgress* GetUnrestrictedMutableUpdateProgressForTest( |
67 ModelSafeGroup group); | 67 ModelSafeGroup group); |
68 | 68 |
69 // ClientToServer messages. | 69 // ClientToServer messages. |
70 const syncer::ModelTypeSet updates_request_types() const { | 70 const syncer::ModelTypeSet updates_request_types() const { |
71 return model_neutral_.updates_request_types; | 71 return model_neutral_.updates_request_types; |
72 } | 72 } |
73 void set_updates_request_types(syncer::ModelTypeSet value) { | 73 void set_updates_request_types(syncer::ModelTypeSet value) { |
74 model_neutral_.updates_request_types = value; | 74 model_neutral_.updates_request_types = value; |
75 } | 75 } |
76 const ClientToServerResponse& updates_response() const { | 76 const sync_pb::ClientToServerResponse& updates_response() const { |
77 return model_neutral_.updates_response; | 77 return model_neutral_.updates_response; |
78 } | 78 } |
79 ClientToServerResponse* mutable_updates_response() { | 79 sync_pb::ClientToServerResponse* mutable_updates_response() { |
80 return &model_neutral_.updates_response; | 80 return &model_neutral_.updates_response; |
81 } | 81 } |
82 | 82 |
83 // Changelog related state. | 83 // Changelog related state. |
84 int64 num_server_changes_remaining() const { | 84 int64 num_server_changes_remaining() const { |
85 return model_neutral_.num_server_changes_remaining; | 85 return model_neutral_.num_server_changes_remaining; |
86 } | 86 } |
87 | 87 |
88 const OrderedCommitSet::Projection& commit_id_projection( | 88 const OrderedCommitSet::Projection& commit_id_projection( |
89 const sessions::OrderedCommitSet &commit_set) { | 89 const sessions::OrderedCommitSet &commit_set) { |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 } | 230 } |
231 private: | 231 private: |
232 StatusController* status_; | 232 StatusController* status_; |
233 DISALLOW_COPY_AND_ASSIGN(ScopedModelSafeGroupRestriction); | 233 DISALLOW_COPY_AND_ASSIGN(ScopedModelSafeGroupRestriction); |
234 }; | 234 }; |
235 | 235 |
236 } // namespace sessions | 236 } // namespace sessions |
237 } // namespace syncer | 237 } // namespace syncer |
238 | 238 |
239 #endif // SYNC_SESSIONS_STATUS_CONTROLLER_H_ | 239 #endif // SYNC_SESSIONS_STATUS_CONTROLLER_H_ |
OLD | NEW |