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

Side by Side Diff: sync/notifier/invalidator.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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 // Interface to the invalidator, which is an object that receives 5 // Interface to the invalidator, which is an object that receives
6 // invalidations for registered object IDs. The corresponding 6 // invalidations for registered object IDs. The corresponding
7 // InvalidationHandler is notifier when such an event occurs. 7 // InvalidationHandler is notifier when such an event occurs.
8 8
9 #ifndef SYNC_NOTIFIER_INVALIDATOR_H_ 9 #ifndef SYNC_NOTIFIER_INVALIDATOR_H_
10 #define SYNC_NOTIFIER_INVALIDATOR_H_ 10 #define SYNC_NOTIFIER_INVALIDATOR_H_
(...skipping 30 matching lines...) Expand all
41 // invalidator->UnregisterHandler(client_handler); 41 // invalidator->UnregisterHandler(client_handler);
42 // 42 //
43 // Note that there's no call to UpdateRegisteredIds() -- this is because the 43 // Note that there's no call to UpdateRegisteredIds() -- this is because the
44 // invalidation API persists registrations across browser restarts. 44 // invalidation API persists registrations across browser restarts.
45 // 45 //
46 // When permanently shutting down the client, e.g. when disabling the related 46 // When permanently shutting down the client, e.g. when disabling the related
47 // feature: 47 // feature:
48 // 48 //
49 // invalidator->UpdateRegisteredIds(client_handler, ObjectIdSet()); 49 // invalidator->UpdateRegisteredIds(client_handler, ObjectIdSet());
50 // invalidator->UnregisterHandler(client_handler); 50 // invalidator->UnregisterHandler(client_handler);
51 //
52 // It is an error to have registered handlers when an invalidator is
53 // destroyed; clients must ensure that they unregister themselves
54 // before then.
51 55
52 // Starts sending notifications to |handler|. |handler| must not be NULL, 56 // Starts sending notifications to |handler|. |handler| must not be NULL,
53 // and it must not already be registered. 57 // and it must not already be registered.
54 virtual void RegisterHandler(InvalidationHandler* handler) = 0; 58 virtual void RegisterHandler(InvalidationHandler* handler) = 0;
55 59
56 // Updates the set of ObjectIds associated with |handler|. |handler| must 60 // Updates the set of ObjectIds associated with |handler|. |handler| must
57 // not be NULL, and must already be registered. An ID must be registered for 61 // not be NULL, and must already be registered. An ID must be registered for
58 // at most one handler. 62 // at most one handler.
59 virtual void UpdateRegisteredIds(InvalidationHandler* handler, 63 virtual void UpdateRegisteredIds(InvalidationHandler* handler,
60 const ObjectIdSet& ids) = 0; 64 const ObjectIdSet& ids) = 0;
(...skipping 27 matching lines...) Expand all
88 // This is here only to support the old p2p notification implementation, 92 // This is here only to support the old p2p notification implementation,
89 // which is still used by sync integration tests. 93 // which is still used by sync integration tests.
90 // TODO(akalin): Remove this once we move the integration tests off p2p 94 // TODO(akalin): Remove this once we move the integration tests off p2p
91 // notifications. 95 // notifications.
92 virtual void SendInvalidation( 96 virtual void SendInvalidation(
93 const ObjectIdInvalidationMap& invalidation_map) = 0; 97 const ObjectIdInvalidationMap& invalidation_map) = 0;
94 }; 98 };
95 } // namespace syncer 99 } // namespace syncer
96 100
97 #endif // SYNC_NOTIFIER_INVALIDATOR_H_ 101 #endif // SYNC_NOTIFIER_INVALIDATOR_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/sync_setup_handler_unittest.cc ('k') | sync/notifier/invalidator_registrar.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698