Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2264)

Unified Diff: chrome/browser/sync/profile_sync_service.h

Issue 11046008: [Invalidations] Require there to be no registered handlers on Invalidator destruction (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync to HEAD Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/sync/invalidation_frontend.h ('k') | chrome/browser/sync/profile_sync_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
};
« no previous file with comments | « chrome/browser/sync/invalidation_frontend.h ('k') | chrome/browser/sync/profile_sync_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698