| 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 // SyncSessionContext encapsulates the contextual information and engine | 5 // SyncSessionContext encapsulates the contextual information and engine |
| 6 // components specific to a SyncSession. A context is accessible via | 6 // components specific to a SyncSession. A context is accessible via |
| 7 // a SyncSession so that session SyncerCommands and parts of the engine have | 7 // a SyncSession so that session SyncerCommands and parts of the engine have |
| 8 // a convenient way to access other parts. In this way it can be thought of as | 8 // a convenient way to access other parts. In this way it can be thought of as |
| 9 // the surrounding environment for the SyncSession. The components of this | 9 // the surrounding environment for the SyncSession. The components of this |
| 10 // environment are either valid or not valid for the entire context lifetime, | 10 // environment are either valid or not valid for the entire context lifetime, |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 class SYNC_EXPORT_PRIVATE SyncSessionContext { | 49 class SYNC_EXPORT_PRIVATE SyncSessionContext { |
| 50 public: | 50 public: |
| 51 SyncSessionContext(ServerConnectionManager* connection_manager, | 51 SyncSessionContext(ServerConnectionManager* connection_manager, |
| 52 syncable::Directory* directory, | 52 syncable::Directory* directory, |
| 53 const std::vector<ModelSafeWorker*>& workers, | 53 const std::vector<ModelSafeWorker*>& workers, |
| 54 ExtensionsActivityMonitor* extensions_activity_monitor, | 54 ExtensionsActivityMonitor* extensions_activity_monitor, |
| 55 ThrottledDataTypeTracker* throttled_data_type_tracker, | 55 ThrottledDataTypeTracker* throttled_data_type_tracker, |
| 56 const std::vector<SyncEngineEventListener*>& listeners, | 56 const std::vector<SyncEngineEventListener*>& listeners, |
| 57 DebugInfoGetter* debug_info_getter, | 57 DebugInfoGetter* debug_info_getter, |
| 58 TrafficRecorder* traffic_recorder, | 58 TrafficRecorder* traffic_recorder, |
| 59 bool keystore_encryption_enabled); | 59 bool keystore_encryption_enabled, |
| 60 const std::string& invalidator_client_id); |
| 60 | 61 |
| 61 ~SyncSessionContext(); | 62 ~SyncSessionContext(); |
| 62 | 63 |
| 63 ServerConnectionManager* connection_manager() { | 64 ServerConnectionManager* connection_manager() { |
| 64 return connection_manager_; | 65 return connection_manager_; |
| 65 } | 66 } |
| 66 syncable::Directory* directory() { | 67 syncable::Directory* directory() { |
| 67 return directory_; | 68 return directory_; |
| 68 } | 69 } |
| 69 | 70 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 } | 124 } |
| 124 | 125 |
| 125 void set_hierarchy_conflict_detected(bool value) { | 126 void set_hierarchy_conflict_detected(bool value) { |
| 126 client_status_.set_hierarchy_conflict_detected(value); | 127 client_status_.set_hierarchy_conflict_detected(value); |
| 127 } | 128 } |
| 128 | 129 |
| 129 const sync_pb::ClientStatus& client_status() const { | 130 const sync_pb::ClientStatus& client_status() const { |
| 130 return client_status_; | 131 return client_status_; |
| 131 } | 132 } |
| 132 | 133 |
| 134 const std::string& invalidator_client_id() const { |
| 135 return invalidator_client_id_; |
| 136 } |
| 137 |
| 133 private: | 138 private: |
| 134 // Rather than force clients to set and null-out various context members, we | 139 // Rather than force clients to set and null-out various context members, we |
| 135 // extend our encapsulation boundary to scoped helpers that take care of this | 140 // extend our encapsulation boundary to scoped helpers that take care of this |
| 136 // once they are allocated. See definitions of these below. | 141 // once they are allocated. See definitions of these below. |
| 137 friend class TestScopedSessionEventListener; | 142 friend class TestScopedSessionEventListener; |
| 138 | 143 |
| 139 ObserverList<SyncEngineEventListener> listeners_; | 144 ObserverList<SyncEngineEventListener> listeners_; |
| 140 | 145 |
| 141 ServerConnectionManager* const connection_manager_; | 146 ServerConnectionManager* const connection_manager_; |
| 142 syncable::Directory* const directory_; | 147 syncable::Directory* const directory_; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 171 TrafficRecorder* traffic_recorder_; | 176 TrafficRecorder* traffic_recorder_; |
| 172 | 177 |
| 173 // Satus information to be sent up to the server. | 178 // Satus information to be sent up to the server. |
| 174 sync_pb::ClientStatus client_status_; | 179 sync_pb::ClientStatus client_status_; |
| 175 | 180 |
| 176 // Temporary variable while keystore encryption is behind a flag. True if | 181 // Temporary variable while keystore encryption is behind a flag. True if |
| 177 // we should attempt performing keystore encryption related work, false if | 182 // we should attempt performing keystore encryption related work, false if |
| 178 // the experiment is not enabled. | 183 // the experiment is not enabled. |
| 179 bool keystore_encryption_enabled_; | 184 bool keystore_encryption_enabled_; |
| 180 | 185 |
| 186 const std::string invalidator_client_id_; |
| 187 |
| 181 DISALLOW_COPY_AND_ASSIGN(SyncSessionContext); | 188 DISALLOW_COPY_AND_ASSIGN(SyncSessionContext); |
| 182 }; | 189 }; |
| 183 | 190 |
| 184 } // namespace sessions | 191 } // namespace sessions |
| 185 } // namespace syncer | 192 } // namespace syncer |
| 186 | 193 |
| 187 #endif // SYNC_SESSIONS_SYNC_SESSION_CONTEXT_H_ | 194 #endif // SYNC_SESSIONS_SYNC_SESSION_CONTEXT_H_ |
| OLD | NEW |