Index: chrome/browser/sync/profile_sync_service.h |
diff --git a/chrome/browser/sync/profile_sync_service.h b/chrome/browser/sync/profile_sync_service.h |
index 4ab847b9af51a51a0e811b4ffcc207c5e7116670..bfeb6761c9e3d096e6ab9e124a388efd8b696db9 100644 |
--- a/chrome/browser/sync/profile_sync_service.h |
+++ b/chrome/browser/sync/profile_sync_service.h |
@@ -41,7 +41,6 @@ |
#include "sync/internal_api/public/util/experiments.h" |
#include "sync/internal_api/public/util/unrecoverable_error_handler.h" |
#include "sync/js/sync_js_controller.h" |
-#include "sync/notifier/invalidator_registrar.h" |
class Profile; |
class ProfileSyncComponentsFactory; |
@@ -60,6 +59,7 @@ namespace sessions { class SyncSessionSnapshot; } |
namespace syncer { |
class BaseTransaction; |
+class InvalidatorRegistrar; |
struct SyncCredentials; |
struct UserShare; |
} |
@@ -218,8 +218,8 @@ class ProfileSyncService : public ProfileSyncServiceBase, |
StartBehavior start_behavior); |
virtual ~ProfileSyncService(); |
- // Initializes the object. This should be called every time an object of this |
- // class is constructed. |
+ // Initializes the object. This must be called at most once, and |
+ // immediately after an object of this class is constructed. |
void Initialize(); |
virtual void SetSyncSetupCompleted(); |
@@ -552,7 +552,8 @@ class ProfileSyncService : public ProfileSyncServiceBase, |
// been cleared yet. Virtual for testing purposes. |
virtual bool waiting_for_auth() const; |
- // InvalidationFrontend implementation. |
+ // InvalidationFrontend implementation. It is an error to have |
+ // registered handlers when Shutdown() is called. |
virtual void RegisterInvalidationHandler( |
syncer::InvalidationHandler* handler) OVERRIDE; |
virtual void UpdateRegisteredInvalidationIds( |
@@ -562,7 +563,8 @@ class ProfileSyncService : public ProfileSyncServiceBase, |
syncer::InvalidationHandler* handler) OVERRIDE; |
virtual syncer::InvalidatorState GetInvalidatorState() const OVERRIDE; |
- // ProfileKeyedService implementation. |
+ // ProfileKeyedService implementation. This must be called exactly |
+ // once (before this object is destroyed). |
virtual void Shutdown() OVERRIDE; |
// Simulate an incoming notification for the given id and payload. |
@@ -841,8 +843,9 @@ class ProfileSyncService : public ProfileSyncServiceBase, |
// Factory the backend will use to build the SyncManager. |
syncer::SyncManagerFactory sync_manager_factory_; |
- // Dispatches invalidations to handlers. |
- syncer::InvalidatorRegistrar invalidator_registrar_; |
+ // Dispatches invalidations to handlers. Set in Initialize() and |
+ // unset in Shutdown(). |
+ scoped_ptr<syncer::InvalidatorRegistrar> invalidator_registrar_; |
DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); |
}; |