| 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 #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 |
| 11 #include "net/base/network_change_notifier.h" | 11 #include "net/base/network_change_notifier.h" |
| 12 #include "sync/base/sync_export.h" | 12 #include "sync/base/sync_export.h" |
| 13 #include "sync/engine/all_status.h" | 13 #include "sync/engine/all_status.h" |
| 14 #include "sync/engine/net/server_connection_manager.h" | 14 #include "sync/engine/net/server_connection_manager.h" |
| 15 #include "sync/engine/sync_engine_event_listener.h" | 15 #include "sync/engine/sync_engine_event_listener.h" |
| 16 #include "sync/internal_api/change_reorder_buffer.h" | 16 #include "sync/internal_api/change_reorder_buffer.h" |
| 17 #include "sync/internal_api/debug_info_event_listener.h" | 17 #include "sync/internal_api/debug_info_event_listener.h" |
| 18 #include "sync/internal_api/js_mutation_event_observer.h" | 18 #include "sync/internal_api/js_mutation_event_observer.h" |
| 19 #include "sync/internal_api/js_sync_encryption_handler_observer.h" | 19 #include "sync/internal_api/js_sync_encryption_handler_observer.h" |
| 20 #include "sync/internal_api/js_sync_manager_observer.h" | 20 #include "sync/internal_api/js_sync_manager_observer.h" |
| 21 #include "sync/internal_api/protocol_event_buffer.h" | 21 #include "sync/internal_api/protocol_event_buffer.h" |
| 22 #include "sync/internal_api/public/base/invalidator_state.h" | 22 #include "sync/internal_api/public/base/invalidator_state.h" |
| 23 #include "sync/internal_api/public/sync_core_proxy.h" | 23 #include "sync/internal_api/public/sync_context_proxy.h" |
| 24 #include "sync/internal_api/public/sync_manager.h" | 24 #include "sync/internal_api/public/sync_manager.h" |
| 25 #include "sync/internal_api/public/user_share.h" | 25 #include "sync/internal_api/public/user_share.h" |
| 26 #include "sync/internal_api/sync_encryption_handler_impl.h" | 26 #include "sync/internal_api/sync_encryption_handler_impl.h" |
| 27 #include "sync/js/js_backend.h" | 27 #include "sync/js/js_backend.h" |
| 28 #include "sync/notifier/invalidation_handler.h" | 28 #include "sync/notifier/invalidation_handler.h" |
| 29 #include "sync/syncable/directory_change_delegate.h" | 29 #include "sync/syncable/directory_change_delegate.h" |
| 30 #include "sync/util/cryptographer.h" | 30 #include "sync/util/cryptographer.h" |
| 31 #include "sync/util/time.h" | 31 #include "sync/util/time.h" |
| 32 | 32 |
| 33 namespace syncer { | 33 namespace syncer { |
| 34 | 34 |
| 35 class ModelTypeRegistry; | 35 class ModelTypeRegistry; |
| 36 class SyncAPIServerConnectionManager; | 36 class SyncAPIServerConnectionManager; |
| 37 class SyncCore; | 37 class SyncContext; |
| 38 class TypeDebugInfoObserver; | 38 class TypeDebugInfoObserver; |
| 39 class WriteNode; | 39 class WriteNode; |
| 40 class WriteTransaction; | 40 class WriteTransaction; |
| 41 | 41 |
| 42 namespace sessions { | 42 namespace sessions { |
| 43 class SyncSessionContext; | 43 class SyncSessionContext; |
| 44 } | 44 } |
| 45 | 45 |
| 46 // SyncManager encapsulates syncable::Directory and serves as the parent of all | 46 // SyncManager encapsulates syncable::Directory and serves as the parent of all |
| 47 // other objects in the sync API. If multiple threads interact with the same | 47 // other objects in the sync API. If multiple threads interact with the same |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 virtual void OnInvalidatorStateChange(InvalidatorState state) OVERRIDE; | 105 virtual void OnInvalidatorStateChange(InvalidatorState state) OVERRIDE; |
| 106 virtual void OnIncomingInvalidation( | 106 virtual void OnIncomingInvalidation( |
| 107 const ObjectIdInvalidationMap& invalidation_map) OVERRIDE; | 107 const ObjectIdInvalidationMap& invalidation_map) OVERRIDE; |
| 108 virtual std::string GetOwnerName() const OVERRIDE; | 108 virtual std::string GetOwnerName() const OVERRIDE; |
| 109 virtual void AddObserver(SyncManager::Observer* observer) OVERRIDE; | 109 virtual void AddObserver(SyncManager::Observer* observer) OVERRIDE; |
| 110 virtual void RemoveObserver(SyncManager::Observer* observer) OVERRIDE; | 110 virtual void RemoveObserver(SyncManager::Observer* observer) OVERRIDE; |
| 111 virtual SyncStatus GetDetailedStatus() const OVERRIDE; | 111 virtual SyncStatus GetDetailedStatus() const OVERRIDE; |
| 112 virtual void SaveChanges() OVERRIDE; | 112 virtual void SaveChanges() OVERRIDE; |
| 113 virtual void ShutdownOnSyncThread() OVERRIDE; | 113 virtual void ShutdownOnSyncThread() OVERRIDE; |
| 114 virtual UserShare* GetUserShare() OVERRIDE; | 114 virtual UserShare* GetUserShare() OVERRIDE; |
| 115 virtual syncer::SyncCoreProxy* GetSyncCoreProxy() OVERRIDE; | 115 virtual syncer::SyncContextProxy* GetSyncContextProxy() OVERRIDE; |
| 116 virtual const std::string cache_guid() OVERRIDE; | 116 virtual const std::string cache_guid() OVERRIDE; |
| 117 virtual bool ReceivedExperiment(Experiments* experiments) OVERRIDE; | 117 virtual bool ReceivedExperiment(Experiments* experiments) OVERRIDE; |
| 118 virtual bool HasUnsyncedItems() OVERRIDE; | 118 virtual bool HasUnsyncedItems() OVERRIDE; |
| 119 virtual SyncEncryptionHandler* GetEncryptionHandler() OVERRIDE; | 119 virtual SyncEncryptionHandler* GetEncryptionHandler() OVERRIDE; |
| 120 virtual ScopedVector<syncer::ProtocolEvent> | 120 virtual ScopedVector<syncer::ProtocolEvent> |
| 121 GetBufferedProtocolEvents() OVERRIDE; | 121 GetBufferedProtocolEvents() OVERRIDE; |
| 122 virtual scoped_ptr<base::ListValue> GetAllNodesForType( | 122 virtual scoped_ptr<base::ListValue> GetAllNodesForType( |
| 123 syncer::ModelType type) OVERRIDE; | 123 syncer::ModelType type) OVERRIDE; |
| 124 virtual void RegisterDirectoryTypeDebugInfoObserver( | 124 virtual void RegisterDirectoryTypeDebugInfoObserver( |
| 125 syncer::TypeDebugInfoObserver* observer) OVERRIDE; | 125 syncer::TypeDebugInfoObserver* observer) OVERRIDE; |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 | 301 |
| 302 // The ServerConnectionManager used to abstract communication between the | 302 // The ServerConnectionManager used to abstract communication between the |
| 303 // client (the Syncer) and the sync server. | 303 // client (the Syncer) and the sync server. |
| 304 scoped_ptr<SyncAPIServerConnectionManager> connection_manager_; | 304 scoped_ptr<SyncAPIServerConnectionManager> connection_manager_; |
| 305 | 305 |
| 306 // Maintains state that affects the way we interact with different sync types. | 306 // Maintains state that affects the way we interact with different sync types. |
| 307 // This state changes when entering or exiting a configuration cycle. | 307 // This state changes when entering or exiting a configuration cycle. |
| 308 scoped_ptr<ModelTypeRegistry> model_type_registry_; | 308 scoped_ptr<ModelTypeRegistry> model_type_registry_; |
| 309 | 309 |
| 310 // The main interface for non-blocking sync types and a thread-safe wrapper. | 310 // The main interface for non-blocking sync types and a thread-safe wrapper. |
| 311 scoped_ptr<SyncCore> sync_core_; | 311 scoped_ptr<SyncContext> sync_context_; |
| 312 scoped_ptr<SyncCoreProxy> sync_core_proxy_; | 312 scoped_ptr<SyncContextProxy> sync_context_proxy_; |
| 313 | 313 |
| 314 // A container of various bits of information used by the SyncScheduler to | 314 // A container of various bits of information used by the SyncScheduler to |
| 315 // create SyncSessions. Must outlive the SyncScheduler. | 315 // create SyncSessions. Must outlive the SyncScheduler. |
| 316 scoped_ptr<sessions::SyncSessionContext> session_context_; | 316 scoped_ptr<sessions::SyncSessionContext> session_context_; |
| 317 | 317 |
| 318 // The scheduler that runs the Syncer. Needs to be explicitly | 318 // The scheduler that runs the Syncer. Needs to be explicitly |
| 319 // Start()ed. | 319 // Start()ed. |
| 320 scoped_ptr<SyncScheduler> scheduler_; | 320 scoped_ptr<SyncScheduler> scheduler_; |
| 321 | 321 |
| 322 // A multi-purpose status watch object that aggregates stats from various | 322 // A multi-purpose status watch object that aggregates stats from various |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 scoped_ptr<SyncEncryptionHandlerImpl> sync_encryption_handler_; | 364 scoped_ptr<SyncEncryptionHandlerImpl> sync_encryption_handler_; |
| 365 | 365 |
| 366 base::WeakPtrFactory<SyncManagerImpl> weak_ptr_factory_; | 366 base::WeakPtrFactory<SyncManagerImpl> weak_ptr_factory_; |
| 367 | 367 |
| 368 DISALLOW_COPY_AND_ASSIGN(SyncManagerImpl); | 368 DISALLOW_COPY_AND_ASSIGN(SyncManagerImpl); |
| 369 }; | 369 }; |
| 370 | 370 |
| 371 } // namespace syncer | 371 } // namespace syncer |
| 372 | 372 |
| 373 #endif // SYNC_INTERNAL_API_SYNC_MANAGER_H_ | 373 #endif // SYNC_INTERNAL_API_SYNC_MANAGER_H_ |
| OLD | NEW |