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

Unified Diff: sync/notifier/sync_notifier.h

Issue 10824252: Revert 150990 - [Sync] Avoid unregistering object IDs on shutdown (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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
« no previous file with comments | « sync/notifier/p2p_notifier_unittest.cc ('k') | sync/notifier/sync_notifier_factory_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/notifier/sync_notifier.h
===================================================================
--- sync/notifier/sync_notifier.h (revision 150991)
+++ sync/notifier/sync_notifier.h (working copy)
@@ -22,46 +22,12 @@
SyncNotifier() {}
virtual ~SyncNotifier() {}
- // Clients should follow the pattern below:
- //
- // When starting the client:
- //
- // notifier->RegisterHandler(client_handler);
- //
- // When the set of IDs to register changes for the client during its lifetime
- // (i.e., between calls to RegisterHandler(client_handler) and
- // UnregisterHandler(client_handler):
- //
- // notifier->UpdateRegisteredIds(client_handler, client_ids);
- //
- // When shutting down the client for browser shutdown:
- //
- // notifier->UnregisterHandler(client_handler);
- //
- // Note that there's no call to UpdateRegisteredIds() -- this is because the
- // invalidation API persists registrations across browser restarts.
- //
- // When permanently shutting down the client, e.g. when disabling the related
- // feature:
- //
- // notifier->UpdateRegisteredIds(client_handler, ObjectIdSet());
- // notifier->UnregisterHandler(client_handler);
-
- // Starts sending notifications to |handler|. |handler| must not be NULL,
- // and it must already be registered.
- virtual void RegisterHandler(SyncNotifierObserver* handler) = 0;
-
- // Updates the set of ObjectIds associated with |handler|. |handler| must
- // not be NULL, and must already be registered. An ID must be registered for
- // at most one handler.
+ // 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.
virtual void UpdateRegisteredIds(SyncNotifierObserver* handler,
const ObjectIdSet& ids) = 0;
- // Stops sending notifications to |handler|. |handler| must not be NULL, and
- // it must already be registered. Note that this doesn't unregister the IDs
- // associated with |handler|.
- virtual void UnregisterHandler(SyncNotifierObserver* handler) = 0;
-
// SetUniqueId must be called once, before any call to
// UpdateCredentials. |unique_id| should be a non-empty globally
// unique string.
« no previous file with comments | « sync/notifier/p2p_notifier_unittest.cc ('k') | sync/notifier/sync_notifier_factory_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698