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

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

Issue 10824161: [Sync] Avoid unregistering object IDs on shutdown (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 8 years, 4 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
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 3e3e14c44f89d32ea2b5753f4d6710119f068f1c..86a99e2a2c9e721bb25860828723666608f9feb5 100644
--- a/chrome/browser/sync/profile_sync_service.h
+++ b/chrome/browser/sync/profile_sync_service.h
@@ -552,13 +552,25 @@ class ProfileSyncService : public browser_sync::SyncFrontend,
// been cleared yet. Virtual for testing purposes.
virtual bool waiting_for_auth() const;
- // Updates the set of ObjectIds associated with a given |handler|.
- // Passing an empty ObjectIdSet will unregister |handler|.
- // There should be at most one handler registered per object id.
+ // NOTE(akalin): Invalidations that come in during browser shutdown may get
+ // dropped. This won't matter once we have an Acknowledge API, though: see
+ // http://crbug.com/78462 and http://crbug.com/124149.
+
+ // Sets the invalidation handler for the given name. Pass in NULL for
+ // |handler| if you want to remove the handler for the given name. (This
+ // doesn't unregister the IDs for the given name, though.) A handler must be
+ // set for at most one name.
//
- // The handler -> registered ids map is persisted across restarts of
+ // The handler name -> handler map is persisted across restarts of sync.
+ void SetInvalidationHandler(const std::string& handler_name,
msw 2012/08/07 20:09:30 I'm wondering if using strings is a necessity to a
+ syncer::SyncNotifierObserver* handler);
+
+ // Updates the set of ObjectIds associated with a given invalidation handler
+ // (via its name). An ID must be registered for at most one handler.
+ //
+ // The handler name -> registered ids map is persisted across restarts of
// sync.
- void UpdateRegisteredInvalidationIds(syncer::SyncNotifierObserver* handler,
+ void UpdateRegisteredInvalidationIds(const std::string& handler_name,
const syncer::ObjectIdSet& ids);
// ProfileKeyedService implementation.
@@ -835,9 +847,6 @@ class ProfileSyncService : public browser_sync::SyncFrontend,
// Factory the backend will use to build the SyncManager.
syncer::SyncManagerFactory sync_manager_factory_;
- // The set of all registered IDs.
- syncer::ObjectIdSet all_registered_ids_;
-
// Dispatches invalidations to handlers.
syncer::SyncNotifierHelper notifier_helper_;

Powered by Google App Engine
This is Rietveld 408576698