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

Side by Side Diff: components/invalidation/invalidator.h

Issue 1146533005: [Sync] InvalidationService shouldn't CHECK when registering ObjectId for more than one handler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments from Bartosz. Created 5 years, 7 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 COMPONENTS_INVALIDATION_INVALIDATOR_H_ 9 #ifndef COMPONENTS_INVALIDATION_INVALIDATOR_H_
10 #define COMPONENTS_INVALIDATION_INVALIDATOR_H_ 10 #define COMPONENTS_INVALIDATION_INVALIDATOR_H_
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 // It is an error to have registered handlers when an invalidator is 52 // It is an error to have registered handlers when an invalidator is
53 // destroyed; clients must ensure that they unregister themselves 53 // destroyed; clients must ensure that they unregister themselves
54 // before then. 54 // before then.
55 55
56 // Starts sending notifications to |handler|. |handler| must not be NULL, 56 // Starts sending notifications to |handler|. |handler| must not be NULL,
57 // and it must not already be registered. 57 // and it must not already be registered.
58 virtual void RegisterHandler(InvalidationHandler* handler) = 0; 58 virtual void RegisterHandler(InvalidationHandler* handler) = 0;
59 59
60 // Updates the set of ObjectIds associated with |handler|. |handler| must 60 // Updates the set of ObjectIds associated with |handler|. |handler| must
61 // 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
62 // at most one handler. 62 // at most one handler. If ID is already registered function returns false.
63 virtual void UpdateRegisteredIds(InvalidationHandler* handler, 63 virtual bool UpdateRegisteredIds(InvalidationHandler* handler,
64 const ObjectIdSet& ids) = 0; 64 const ObjectIdSet& ids)
65 WARN_UNUSED_RESULT = 0;
65 66
66 // Stops sending notifications to |handler|. |handler| must not be NULL, and 67 // Stops sending notifications to |handler|. |handler| must not be NULL, and
67 // it must already be registered. Note that this doesn't unregister the IDs 68 // it must already be registered. Note that this doesn't unregister the IDs
68 // associated with |handler|. 69 // associated with |handler|.
69 virtual void UnregisterHandler(InvalidationHandler* handler) = 0; 70 virtual void UnregisterHandler(InvalidationHandler* handler) = 0;
70 71
71 // Returns the current invalidator state. When called from within 72 // Returns the current invalidator state. When called from within
72 // InvalidationHandler::OnInvalidatorStateChange(), this must return 73 // InvalidationHandler::OnInvalidatorStateChange(), this must return
73 // the updated state. 74 // the updated state.
74 virtual InvalidatorState GetInvalidatorState() const = 0; 75 virtual InvalidatorState GetInvalidatorState() const = 0;
75 76
76 // The observers won't be notified of any notifications until 77 // The observers won't be notified of any notifications until
77 // UpdateCredentials is called at least once. It can be called more than 78 // UpdateCredentials is called at least once. It can be called more than
78 // once. 79 // once.
79 virtual void UpdateCredentials( 80 virtual void UpdateCredentials(
80 const std::string& email, const std::string& token) = 0; 81 const std::string& email, const std::string& token) = 0;
81 82
82 // Requests internal detailed status to be posted back to the callback. 83 // Requests internal detailed status to be posted back to the callback.
83 virtual void RequestDetailedStatus( 84 virtual void RequestDetailedStatus(
84 base::Callback<void(const base::DictionaryValue&)> callback) const = 0; 85 base::Callback<void(const base::DictionaryValue&)> callback) const = 0;
85 }; 86 };
86 } // namespace syncer 87 } // namespace syncer
87 88
88 #endif // COMPONENTS_INVALIDATION_INVALIDATOR_H_ 89 #endif // COMPONENTS_INVALIDATION_INVALIDATOR_H_
OLDNEW
« no previous file with comments | « components/invalidation/invalidation_service_test_template.h ('k') | components/invalidation/invalidator_registrar.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698