| 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 #ifndef SYNC_INTERNAL_API_SYNC_MANAGER_H_ | 5 #ifndef SYNC_INTERNAL_API_SYNC_MANAGER_H_ |
| 6 #define SYNC_INTERNAL_API_SYNC_MANAGER_H_ | 6 #define SYNC_INTERNAL_API_SYNC_MANAGER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 public ServerConnectionEventListener, | 52 public ServerConnectionEventListener, |
| 53 public syncable::DirectoryChangeDelegate { | 53 public syncable::DirectoryChangeDelegate { |
| 54 public: | 54 public: |
| 55 // Create an uninitialized SyncManager. Callers must Init() before using. | 55 // Create an uninitialized SyncManager. Callers must Init() before using. |
| 56 explicit SyncManagerImpl(const std::string& name); | 56 explicit SyncManagerImpl(const std::string& name); |
| 57 virtual ~SyncManagerImpl(); | 57 virtual ~SyncManagerImpl(); |
| 58 | 58 |
| 59 // SyncManager implementation. | 59 // SyncManager implementation. |
| 60 virtual bool Init( | 60 virtual bool Init( |
| 61 const FilePath& database_location, | 61 const FilePath& database_location, |
| 62 const syncer::WeakHandle<syncer::JsEventHandler>& event_handler, | 62 const WeakHandle<JsEventHandler>& event_handler, |
| 63 const std::string& sync_server_and_path, | 63 const std::string& sync_server_and_path, |
| 64 int sync_server_port, | 64 int sync_server_port, |
| 65 bool use_ssl, | 65 bool use_ssl, |
| 66 const scoped_refptr<base::TaskRunner>& blocking_task_runner, | 66 const scoped_refptr<base::TaskRunner>& blocking_task_runner, |
| 67 scoped_ptr<HttpPostProviderFactory> post_factory, | 67 scoped_ptr<HttpPostProviderFactory> post_factory, |
| 68 const syncer::ModelSafeRoutingInfo& model_safe_routing_info, | 68 const ModelSafeRoutingInfo& model_safe_routing_info, |
| 69 const std::vector<syncer::ModelSafeWorker*>& workers, | 69 const std::vector<ModelSafeWorker*>& workers, |
| 70 syncer::ExtensionsActivityMonitor* extensions_activity_monitor, | 70 ExtensionsActivityMonitor* extensions_activity_monitor, |
| 71 SyncManager::ChangeDelegate* change_delegate, | 71 SyncManager::ChangeDelegate* change_delegate, |
| 72 const SyncCredentials& credentials, | 72 const SyncCredentials& credentials, |
| 73 scoped_ptr<syncer::SyncNotifier> sync_notifier, | 73 scoped_ptr<SyncNotifier> sync_notifier, |
| 74 const std::string& restored_key_for_bootstrapping, | 74 const std::string& restored_key_for_bootstrapping, |
| 75 scoped_ptr<InternalComponentsFactory> internal_components_factory, | 75 scoped_ptr<InternalComponentsFactory> internal_components_factory, |
| 76 syncer::Encryptor* encryptor, | 76 Encryptor* encryptor, |
| 77 syncer::UnrecoverableErrorHandler* unrecoverable_error_handler, | 77 UnrecoverableErrorHandler* unrecoverable_error_handler, |
| 78 syncer::ReportUnrecoverableErrorFunction | 78 ReportUnrecoverableErrorFunction |
| 79 report_unrecoverable_error_function) OVERRIDE; | 79 report_unrecoverable_error_function) OVERRIDE; |
| 80 virtual void ThrowUnrecoverableError() OVERRIDE; | 80 virtual void ThrowUnrecoverableError() OVERRIDE; |
| 81 virtual syncer::ModelTypeSet InitialSyncEndedTypes() OVERRIDE; | 81 virtual ModelTypeSet InitialSyncEndedTypes() OVERRIDE; |
| 82 virtual syncer::ModelTypeSet GetTypesWithEmptyProgressMarkerToken( | 82 virtual ModelTypeSet GetTypesWithEmptyProgressMarkerToken( |
| 83 syncer::ModelTypeSet types) OVERRIDE; | 83 ModelTypeSet types) OVERRIDE; |
| 84 virtual bool PurgePartiallySyncedTypes() OVERRIDE; | 84 virtual bool PurgePartiallySyncedTypes() OVERRIDE; |
| 85 virtual void UpdateCredentials(const SyncCredentials& credentials) OVERRIDE; | 85 virtual void UpdateCredentials(const SyncCredentials& credentials) OVERRIDE; |
| 86 virtual void UpdateEnabledTypes( | 86 virtual void UpdateEnabledTypes( |
| 87 const syncer::ModelTypeSet& enabled_types) OVERRIDE; | 87 const ModelTypeSet& enabled_types) OVERRIDE; |
| 88 virtual void StartSyncingNormally( | 88 virtual void StartSyncingNormally( |
| 89 const syncer::ModelSafeRoutingInfo& routing_info) OVERRIDE; | 89 const ModelSafeRoutingInfo& routing_info) OVERRIDE; |
| 90 virtual void SetEncryptionPassphrase(const std::string& passphrase, | 90 virtual void SetEncryptionPassphrase(const std::string& passphrase, |
| 91 bool is_explicit) OVERRIDE; | 91 bool is_explicit) OVERRIDE; |
| 92 virtual void SetDecryptionPassphrase(const std::string& passphrase) OVERRIDE; | 92 virtual void SetDecryptionPassphrase(const std::string& passphrase) OVERRIDE; |
| 93 virtual void ConfigureSyncer( | 93 virtual void ConfigureSyncer( |
| 94 ConfigureReason reason, | 94 ConfigureReason reason, |
| 95 const syncer::ModelTypeSet& types_to_config, | 95 const ModelTypeSet& types_to_config, |
| 96 const syncer::ModelSafeRoutingInfo& new_routing_info, | 96 const ModelSafeRoutingInfo& new_routing_info, |
| 97 const base::Closure& ready_task, | 97 const base::Closure& ready_task, |
| 98 const base::Closure& retry_task) OVERRIDE; | 98 const base::Closure& retry_task) OVERRIDE; |
| 99 virtual void AddObserver(SyncManager::Observer* observer) OVERRIDE; | 99 virtual void AddObserver(SyncManager::Observer* observer) OVERRIDE; |
| 100 virtual void RemoveObserver(SyncManager::Observer* observer) OVERRIDE; | 100 virtual void RemoveObserver(SyncManager::Observer* observer) OVERRIDE; |
| 101 virtual SyncStatus GetDetailedStatus() const OVERRIDE; | 101 virtual SyncStatus GetDetailedStatus() const OVERRIDE; |
| 102 virtual bool IsUsingExplicitPassphrase() OVERRIDE; | 102 virtual bool IsUsingExplicitPassphrase() OVERRIDE; |
| 103 virtual void SaveChanges() OVERRIDE; | 103 virtual void SaveChanges() OVERRIDE; |
| 104 virtual void StopSyncingForShutdown(const base::Closure& callback) OVERRIDE; | 104 virtual void StopSyncingForShutdown(const base::Closure& callback) OVERRIDE; |
| 105 virtual void ShutdownOnSyncThread() OVERRIDE; | 105 virtual void ShutdownOnSyncThread() OVERRIDE; |
| 106 virtual UserShare* GetUserShare() OVERRIDE; | 106 virtual UserShare* GetUserShare() OVERRIDE; |
| 107 | 107 |
| 108 // Update the Cryptographer from the current nigori node and write back any | 108 // Update the Cryptographer from the current nigori node and write back any |
| 109 // necessary changes to the nigori node. We also detect missing encryption | 109 // necessary changes to the nigori node. We also detect missing encryption |
| 110 // keys and write them into the nigori node. | 110 // keys and write them into the nigori node. |
| 111 // Also updates or adds the device information into the nigori node. | 111 // Also updates or adds the device information into the nigori node. |
| 112 // Note: opens a transaction and can trigger an ON_PASSPHRASE_REQUIRED, so | 112 // Note: opens a transaction and can trigger an ON_PASSPHRASE_REQUIRED, so |
| 113 // should only be called after syncapi is fully initialized. | 113 // should only be called after syncapi is fully initialized. |
| 114 // Calls the callback argument with true if cryptographer is ready, false | 114 // Calls the callback argument with true if cryptographer is ready, false |
| 115 // otherwise. | 115 // otherwise. |
| 116 virtual void RefreshNigori(const std::string& chrome_version, | 116 virtual void RefreshNigori(const std::string& chrome_version, |
| 117 const base::Closure& done_callback) OVERRIDE; | 117 const base::Closure& done_callback) OVERRIDE; |
| 118 | 118 |
| 119 virtual void EnableEncryptEverything() OVERRIDE; | 119 virtual void EnableEncryptEverything() OVERRIDE; |
| 120 virtual bool ReceivedExperiment(syncer::Experiments* experiments) OVERRIDE; | 120 virtual bool ReceivedExperiment(Experiments* experiments) OVERRIDE; |
| 121 virtual bool HasUnsyncedItems() OVERRIDE; | 121 virtual bool HasUnsyncedItems() OVERRIDE; |
| 122 | 122 |
| 123 // Return the currently active (validated) username for use with syncable | 123 // Return the currently active (validated) username for use with syncable |
| 124 // types. | 124 // types. |
| 125 const std::string& username_for_share() const; | 125 const std::string& username_for_share() const; |
| 126 | 126 |
| 127 // Functions used for testing. | 127 // Functions used for testing. |
| 128 | 128 |
| 129 // Returns true if we are currently encrypting all sync data. May | 129 // Returns true if we are currently encrypting all sync data. May |
| 130 // be called on any thread. | 130 // be called on any thread. |
| 131 bool EncryptEverythingEnabledForTest(); | 131 bool EncryptEverythingEnabledForTest(); |
| 132 | 132 |
| 133 // Gets the set of encrypted types from the cryptographer | 133 // Gets the set of encrypted types from the cryptographer |
| 134 // Note: opens a transaction. May be called from any thread. | 134 // Note: opens a transaction. May be called from any thread. |
| 135 syncer::ModelTypeSet GetEncryptedDataTypesForTest(); | 135 ModelTypeSet GetEncryptedDataTypesForTest(); |
| 136 | 136 |
| 137 void SimulateEnableNotificationsForTest(); | 137 void SimulateEnableNotificationsForTest(); |
| 138 void SimulateDisableNotificationsForTest(int reason); | 138 void SimulateDisableNotificationsForTest(int reason); |
| 139 void TriggerOnIncomingNotificationForTest(syncer::ModelTypeSet model_types); | 139 void TriggerOnIncomingNotificationForTest(ModelTypeSet model_types); |
| 140 | 140 |
| 141 static int GetDefaultNudgeDelay(); | 141 static int GetDefaultNudgeDelay(); |
| 142 static int GetPreferencesNudgeDelay(); | 142 static int GetPreferencesNudgeDelay(); |
| 143 | 143 |
| 144 // SyncEngineEventListener implementation. | 144 // SyncEngineEventListener implementation. |
| 145 virtual void OnSyncEngineEvent(const SyncEngineEvent& event) OVERRIDE; | 145 virtual void OnSyncEngineEvent(const SyncEngineEvent& event) OVERRIDE; |
| 146 | 146 |
| 147 // ServerConnectionEventListener implementation. | 147 // ServerConnectionEventListener implementation. |
| 148 virtual void OnServerConnectionEvent( | 148 virtual void OnServerConnectionEvent( |
| 149 const ServerConnectionEvent& event) OVERRIDE; | 149 const ServerConnectionEvent& event) OVERRIDE; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 166 syncable::BaseTransaction* trans) OVERRIDE; | 166 syncable::BaseTransaction* trans) OVERRIDE; |
| 167 virtual void HandleCalculateChangesChangeEventFromSyncApi( | 167 virtual void HandleCalculateChangesChangeEventFromSyncApi( |
| 168 const syncable::ImmutableWriteTransactionInfo& write_transaction_info, | 168 const syncable::ImmutableWriteTransactionInfo& write_transaction_info, |
| 169 syncable::BaseTransaction* trans) OVERRIDE; | 169 syncable::BaseTransaction* trans) OVERRIDE; |
| 170 virtual void HandleCalculateChangesChangeEventFromSyncer( | 170 virtual void HandleCalculateChangesChangeEventFromSyncer( |
| 171 const syncable::ImmutableWriteTransactionInfo& write_transaction_info, | 171 const syncable::ImmutableWriteTransactionInfo& write_transaction_info, |
| 172 syncable::BaseTransaction* trans) OVERRIDE; | 172 syncable::BaseTransaction* trans) OVERRIDE; |
| 173 | 173 |
| 174 // Cryptographer::Observer implementation. | 174 // Cryptographer::Observer implementation. |
| 175 virtual void OnEncryptedTypesChanged( | 175 virtual void OnEncryptedTypesChanged( |
| 176 syncer::ModelTypeSet encrypted_types, | 176 ModelTypeSet encrypted_types, |
| 177 bool encrypt_everything) OVERRIDE; | 177 bool encrypt_everything) OVERRIDE; |
| 178 | 178 |
| 179 // SyncNotifierObserver implementation. | 179 // SyncNotifierObserver implementation. |
| 180 virtual void OnNotificationsEnabled() OVERRIDE; | 180 virtual void OnNotificationsEnabled() OVERRIDE; |
| 181 virtual void OnNotificationsDisabled( | 181 virtual void OnNotificationsDisabled( |
| 182 syncer::NotificationsDisabledReason reason) OVERRIDE; | 182 NotificationsDisabledReason reason) OVERRIDE; |
| 183 virtual void OnIncomingNotification( | 183 virtual void OnIncomingNotification( |
| 184 const syncer::ModelTypePayloadMap& type_payloads, | 184 const ModelTypePayloadMap& type_payloads, |
| 185 syncer::IncomingNotificationSource source) OVERRIDE; | 185 IncomingNotificationSource source) OVERRIDE; |
| 186 | 186 |
| 187 // Called only by our NetworkChangeNotifier. | 187 // Called only by our NetworkChangeNotifier. |
| 188 virtual void OnIPAddressChanged() OVERRIDE; | 188 virtual void OnIPAddressChanged() OVERRIDE; |
| 189 | 189 |
| 190 const SyncScheduler* scheduler() const; | 190 const SyncScheduler* scheduler() const; |
| 191 | 191 |
| 192 private: | 192 private: |
| 193 friend class SyncManagerTest; | 193 friend class SyncManagerTest; |
| 194 FRIEND_TEST_ALL_PREFIXES(SyncManagerTest, NudgeDelayTest); | 194 FRIEND_TEST_ALL_PREFIXES(SyncManagerTest, NudgeDelayTest); |
| 195 FRIEND_TEST_ALL_PREFIXES(SyncManagerTest, OnNotificationStateChange); | 195 FRIEND_TEST_ALL_PREFIXES(SyncManagerTest, OnNotificationStateChange); |
| 196 FRIEND_TEST_ALL_PREFIXES(SyncManagerTest, OnIncomingNotification); | 196 FRIEND_TEST_ALL_PREFIXES(SyncManagerTest, OnIncomingNotification); |
| 197 | 197 |
| 198 struct NotificationInfo { | 198 struct NotificationInfo { |
| 199 NotificationInfo(); | 199 NotificationInfo(); |
| 200 ~NotificationInfo(); | 200 ~NotificationInfo(); |
| 201 | 201 |
| 202 int total_count; | 202 int total_count; |
| 203 std::string payload; | 203 std::string payload; |
| 204 | 204 |
| 205 // Returned pointer owned by the caller. | 205 // Returned pointer owned by the caller. |
| 206 DictionaryValue* ToValue() const; | 206 DictionaryValue* ToValue() const; |
| 207 }; | 207 }; |
| 208 | 208 |
| 209 base::TimeDelta GetNudgeDelayTimeDelta(const syncer::ModelType& model_type); | 209 base::TimeDelta GetNudgeDelayTimeDelta(const ModelType& model_type); |
| 210 | 210 |
| 211 typedef std::map<syncer::ModelType, NotificationInfo> NotificationInfoMap; | 211 typedef std::map<ModelType, NotificationInfo> NotificationInfoMap; |
| 212 typedef JsArgList (SyncManagerImpl::*UnboundJsMessageHandler)( | 212 typedef JsArgList (SyncManagerImpl::*UnboundJsMessageHandler)( |
| 213 const JsArgList&); | 213 const JsArgList&); |
| 214 typedef base::Callback<JsArgList(const JsArgList&)> JsMessageHandler; | 214 typedef base::Callback<JsArgList(const JsArgList&)> JsMessageHandler; |
| 215 typedef std::map<std::string, JsMessageHandler> JsMessageHandlerMap; | 215 typedef std::map<std::string, JsMessageHandler> JsMessageHandlerMap; |
| 216 | 216 |
| 217 // Determine if the parents or predecessors differ between the old and new | 217 // Determine if the parents or predecessors differ between the old and new |
| 218 // versions of an entry stored in |a| and |b|. Note that a node's index may | 218 // versions of an entry stored in |a| and |b|. Note that a node's index may |
| 219 // change without its NEXT_ID changing if the node at NEXT_ID also moved (but | 219 // change without its NEXT_ID changing if the node at NEXT_ID also moved (but |
| 220 // the relative order is unchanged). To handle such cases, we rely on the | 220 // the relative order is unchanged). To handle such cases, we rely on the |
| 221 // caller to treat a position update on any sibling as updating the positions | 221 // caller to treat a position update on any sibling as updating the positions |
| (...skipping 22 matching lines...) Expand all Loading... |
| 244 void RequestNudgeForDataTypes( | 244 void RequestNudgeForDataTypes( |
| 245 const tracked_objects::Location& nudge_location, | 245 const tracked_objects::Location& nudge_location, |
| 246 ModelTypeSet type); | 246 ModelTypeSet type); |
| 247 | 247 |
| 248 void NotifyCryptographerState(Cryptographer* cryptographer); | 248 void NotifyCryptographerState(Cryptographer* cryptographer); |
| 249 | 249 |
| 250 // If this is a deletion for a password, sets the legacy | 250 // If this is a deletion for a password, sets the legacy |
| 251 // ExtraPasswordChangeRecordData field of |buffer|. Otherwise sets | 251 // ExtraPasswordChangeRecordData field of |buffer|. Otherwise sets |
| 252 // |buffer|'s specifics field to contain the unencrypted data. | 252 // |buffer|'s specifics field to contain the unencrypted data. |
| 253 void SetExtraChangeRecordData(int64 id, | 253 void SetExtraChangeRecordData(int64 id, |
| 254 syncer::ModelType type, | 254 ModelType type, |
| 255 ChangeReorderBuffer* buffer, | 255 ChangeReorderBuffer* buffer, |
| 256 Cryptographer* cryptographer, | 256 Cryptographer* cryptographer, |
| 257 const syncable::EntryKernel& original, | 257 const syncable::EntryKernel& original, |
| 258 bool existed_before, | 258 bool existed_before, |
| 259 bool exists_now); | 259 bool exists_now); |
| 260 | 260 |
| 261 // Stores the current set of encryption keys (if the cryptographer is ready) | 261 // Stores the current set of encryption keys (if the cryptographer is ready) |
| 262 // and encrypted types into the nigori node. | 262 // and encrypted types into the nigori node. |
| 263 void UpdateNigoriEncryptionState(Cryptographer* cryptographer, | 263 void UpdateNigoriEncryptionState(Cryptographer* cryptographer, |
| 264 WriteNode* nigori_node); | 264 WriteNode* nigori_node); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 291 void FinishSetPassphrase( | 291 void FinishSetPassphrase( |
| 292 bool success, | 292 bool success, |
| 293 const std::string& bootstrap_token, | 293 const std::string& bootstrap_token, |
| 294 bool is_explicit, | 294 bool is_explicit, |
| 295 WriteTransaction* trans, | 295 WriteTransaction* trans, |
| 296 WriteNode* nigori_node); | 296 WriteNode* nigori_node); |
| 297 | 297 |
| 298 // Called for every notification. This updates the notification statistics | 298 // Called for every notification. This updates the notification statistics |
| 299 // to be displayed in about:sync. | 299 // to be displayed in about:sync. |
| 300 void UpdateNotificationInfo( | 300 void UpdateNotificationInfo( |
| 301 const syncer::ModelTypePayloadMap& type_payloads); | 301 const ModelTypePayloadMap& type_payloads); |
| 302 | 302 |
| 303 // Checks for server reachabilty and requests a nudge. | 303 // Checks for server reachabilty and requests a nudge. |
| 304 void OnIPAddressChangedImpl(); | 304 void OnIPAddressChangedImpl(); |
| 305 | 305 |
| 306 // Helper function used only by the constructor. | 306 // Helper function used only by the constructor. |
| 307 void BindJsMessageHandler( | 307 void BindJsMessageHandler( |
| 308 const std::string& name, UnboundJsMessageHandler unbound_message_handler); | 308 const std::string& name, UnboundJsMessageHandler unbound_message_handler); |
| 309 | 309 |
| 310 // Returned pointer is owned by the caller. | 310 // Returned pointer is owned by the caller. |
| 311 static DictionaryValue* NotificationInfoToValue( | 311 static DictionaryValue* NotificationInfoToValue( |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 // |blocking_task_runner| is a TaskRunner to be used for tasks that | 345 // |blocking_task_runner| is a TaskRunner to be used for tasks that |
| 346 // may block on disk I/O. | 346 // may block on disk I/O. |
| 347 scoped_refptr<base::TaskRunner> blocking_task_runner_; | 347 scoped_refptr<base::TaskRunner> blocking_task_runner_; |
| 348 | 348 |
| 349 // We give a handle to share_ to clients of the API for use when constructing | 349 // We give a handle to share_ to clients of the API for use when constructing |
| 350 // any transaction type. | 350 // any transaction type. |
| 351 UserShare share_; | 351 UserShare share_; |
| 352 | 352 |
| 353 // This can be called from any thread, but only between calls to | 353 // This can be called from any thread, but only between calls to |
| 354 // OpenDirectory() and ShutdownOnSyncThread(). | 354 // OpenDirectory() and ShutdownOnSyncThread(). |
| 355 syncer::WeakHandle<SyncManager::ChangeObserver> change_observer_; | 355 WeakHandle<SyncManager::ChangeObserver> change_observer_; |
| 356 | 356 |
| 357 ObserverList<SyncManager::Observer> observers_; | 357 ObserverList<SyncManager::Observer> observers_; |
| 358 | 358 |
| 359 // The ServerConnectionManager used to abstract communication between the | 359 // The ServerConnectionManager used to abstract communication between the |
| 360 // client (the Syncer) and the sync server. | 360 // client (the Syncer) and the sync server. |
| 361 scoped_ptr<SyncAPIServerConnectionManager> connection_manager_; | 361 scoped_ptr<SyncAPIServerConnectionManager> connection_manager_; |
| 362 | 362 |
| 363 // A container of various bits of information used by the SyncScheduler to | 363 // A container of various bits of information used by the SyncScheduler to |
| 364 // create SyncSessions. Must outlive the SyncScheduler. | 364 // create SyncSessions. Must outlive the SyncScheduler. |
| 365 scoped_ptr<sessions::SyncSessionContext> session_context_; | 365 scoped_ptr<sessions::SyncSessionContext> session_context_; |
| 366 | 366 |
| 367 // The scheduler that runs the Syncer. Needs to be explicitly | 367 // The scheduler that runs the Syncer. Needs to be explicitly |
| 368 // Start()ed. | 368 // Start()ed. |
| 369 scoped_ptr<SyncScheduler> scheduler_; | 369 scoped_ptr<SyncScheduler> scheduler_; |
| 370 | 370 |
| 371 // The SyncNotifier which notifies us when updates need to be downloaded. | 371 // The SyncNotifier which notifies us when updates need to be downloaded. |
| 372 scoped_ptr<syncer::SyncNotifier> sync_notifier_; | 372 scoped_ptr<SyncNotifier> sync_notifier_; |
| 373 | 373 |
| 374 // A multi-purpose status watch object that aggregates stats from various | 374 // A multi-purpose status watch object that aggregates stats from various |
| 375 // sync components. | 375 // sync components. |
| 376 AllStatus allstatus_; | 376 AllStatus allstatus_; |
| 377 | 377 |
| 378 // Each element of this array is a store of change records produced by | 378 // Each element of this array is a store of change records produced by |
| 379 // HandleChangeEvent during the CALCULATE_CHANGES step. The changes are | 379 // HandleChangeEvent during the CALCULATE_CHANGES step. The changes are |
| 380 // segregated by model type, and are stored here to be processed and | 380 // segregated by model type, and are stored here to be processed and |
| 381 // forwarded to the observer slightly later, at the TRANSACTION_ENDING | 381 // forwarded to the observer slightly later, at the TRANSACTION_ENDING |
| 382 // step by HandleTransactionEndingChangeEvent. The list is cleared in the | 382 // step by HandleTransactionEndingChangeEvent. The list is cleared in the |
| 383 // TRANSACTION_COMPLETE step by HandleTransactionCompleteChangeEvent. | 383 // TRANSACTION_COMPLETE step by HandleTransactionCompleteChangeEvent. |
| 384 ChangeReorderBuffer change_buffers_[syncer::MODEL_TYPE_COUNT]; | 384 ChangeReorderBuffer change_buffers_[MODEL_TYPE_COUNT]; |
| 385 | 385 |
| 386 SyncManager::ChangeDelegate* change_delegate_; | 386 SyncManager::ChangeDelegate* change_delegate_; |
| 387 | 387 |
| 388 // Set to true once Init has been called. | 388 // Set to true once Init has been called. |
| 389 bool initialized_; | 389 bool initialized_; |
| 390 | 390 |
| 391 bool observing_ip_address_changes_; | 391 bool observing_ip_address_changes_; |
| 392 | 392 |
| 393 // Map used to store the notification info to be displayed in | 393 // Map used to store the notification info to be displayed in |
| 394 // about:sync page. | 394 // about:sync page. |
| 395 NotificationInfoMap notification_info_map_; | 395 NotificationInfoMap notification_info_map_; |
| 396 | 396 |
| 397 // These are for interacting with chrome://sync-internals. | 397 // These are for interacting with chrome://sync-internals. |
| 398 JsMessageHandlerMap js_message_handlers_; | 398 JsMessageHandlerMap js_message_handlers_; |
| 399 WeakHandle<JsEventHandler> js_event_handler_; | 399 WeakHandle<JsEventHandler> js_event_handler_; |
| 400 JsSyncManagerObserver js_sync_manager_observer_; | 400 JsSyncManagerObserver js_sync_manager_observer_; |
| 401 JsMutationEventObserver js_mutation_event_observer_; | 401 JsMutationEventObserver js_mutation_event_observer_; |
| 402 | 402 |
| 403 syncer::ThrottledDataTypeTracker throttled_data_type_tracker_; | 403 ThrottledDataTypeTracker throttled_data_type_tracker_; |
| 404 | 404 |
| 405 // This is for keeping track of client events to send to the server. | 405 // This is for keeping track of client events to send to the server. |
| 406 DebugInfoEventListener debug_info_event_listener_; | 406 DebugInfoEventListener debug_info_event_listener_; |
| 407 | 407 |
| 408 syncer::TrafficRecorder traffic_recorder_; | 408 TrafficRecorder traffic_recorder_; |
| 409 | 409 |
| 410 Encryptor* encryptor_; | 410 Encryptor* encryptor_; |
| 411 UnrecoverableErrorHandler* unrecoverable_error_handler_; | 411 UnrecoverableErrorHandler* unrecoverable_error_handler_; |
| 412 ReportUnrecoverableErrorFunction report_unrecoverable_error_function_; | 412 ReportUnrecoverableErrorFunction report_unrecoverable_error_function_; |
| 413 | 413 |
| 414 // The number of times we've automatically (i.e. not via SetPassphrase or | 414 // The number of times we've automatically (i.e. not via SetPassphrase or |
| 415 // conflict resolver) updated the nigori's encryption keys in this chrome | 415 // conflict resolver) updated the nigori's encryption keys in this chrome |
| 416 // instantiation. | 416 // instantiation. |
| 417 int nigori_overwrite_count_; | 417 int nigori_overwrite_count_; |
| 418 | 418 |
| 419 DISALLOW_COPY_AND_ASSIGN(SyncManagerImpl); | 419 DISALLOW_COPY_AND_ASSIGN(SyncManagerImpl); |
| 420 }; | 420 }; |
| 421 | 421 |
| 422 } // namespace syncer | 422 } // namespace syncer |
| 423 | 423 |
| 424 #endif // SYNC_INTERNAL_API_SYNC_MANAGER_H_ | 424 #endif // SYNC_INTERNAL_API_SYNC_MANAGER_H_ |
| OLD | NEW |