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