| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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. | 6 // state tracking on behalf of a SyncSession. |
| 7 // | 7 // |
| 8 // The most important feature of StatusController is the | 8 // The most important feature of StatusController is the |
| 9 // ScopedModelSafeGroupRestriction. Some of its functions expose per-thread | 9 // ScopedModelSafeGroupRestriction. Some of its functions expose per-thread |
| 10 // state, and can be called only when the restriction is in effect. For | 10 // state, and can be called only when the restriction is in effect. For |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 explicit StatusController(); | 46 explicit StatusController(); |
| 47 ~StatusController(); | 47 ~StatusController(); |
| 48 | 48 |
| 49 // ClientToServer messages. | 49 // ClientToServer messages. |
| 50 const ModelTypeSet updates_request_types() const { | 50 const ModelTypeSet updates_request_types() const { |
| 51 return model_neutral_.updates_request_types; | 51 return model_neutral_.updates_request_types; |
| 52 } | 52 } |
| 53 void set_updates_request_types(ModelTypeSet value) { | 53 void set_updates_request_types(ModelTypeSet value) { |
| 54 model_neutral_.updates_request_types = value; | 54 model_neutral_.updates_request_types = value; |
| 55 } | 55 } |
| 56 const ModelTypeSet commit_request_types() const { |
| 57 return model_neutral_.commit_request_types; |
| 58 } |
| 59 void set_commit_request_types(ModelTypeSet value) { |
| 60 model_neutral_.commit_request_types = value; |
| 61 } |
| 56 const sync_pb::ClientToServerResponse& updates_response() const { | 62 const sync_pb::ClientToServerResponse& updates_response() const { |
| 57 return model_neutral_.updates_response; | 63 return model_neutral_.updates_response; |
| 58 } | 64 } |
| 59 sync_pb::ClientToServerResponse* mutable_updates_response() { | 65 sync_pb::ClientToServerResponse* mutable_updates_response() { |
| 60 return &model_neutral_.updates_response; | 66 return &model_neutral_.updates_response; |
| 61 } | 67 } |
| 62 | 68 |
| 63 // Changelog related state. | 69 // Changelog related state. |
| 64 int64 num_server_changes_remaining() const { | 70 int64 num_server_changes_remaining() const { |
| 65 return model_neutral_.num_server_changes_remaining; | 71 return model_neutral_.num_server_changes_remaining; |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 } | 190 } |
| 185 private: | 191 private: |
| 186 StatusController* status_; | 192 StatusController* status_; |
| 187 DISALLOW_COPY_AND_ASSIGN(ScopedModelSafeGroupRestriction); | 193 DISALLOW_COPY_AND_ASSIGN(ScopedModelSafeGroupRestriction); |
| 188 }; | 194 }; |
| 189 | 195 |
| 190 } // namespace sessions | 196 } // namespace sessions |
| 191 } // namespace syncer | 197 } // namespace syncer |
| 192 | 198 |
| 193 #endif // SYNC_SESSIONS_STATUS_CONTROLLER_H_ | 199 #endif // SYNC_SESSIONS_STATUS_CONTROLLER_H_ |
| OLD | NEW |