OLD | NEW |
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 #ifndef COMPONENTS_INVALIDATION_INVALIDATION_SERVICE_H_ | 5 #ifndef COMPONENTS_INVALIDATION_INVALIDATION_SERVICE_H_ |
6 #define COMPONENTS_INVALIDATION_INVALIDATION_SERVICE_H_ | 6 #define COMPONENTS_INVALIDATION_INVALIDATION_SERVICE_H_ |
7 | 7 |
8 #include "base/callback_forward.h" | 8 #include "base/callback_forward.h" |
9 #include "components/invalidation/invalidation_util.h" | 9 #include "components/invalidation/invalidation_util.h" |
10 #include "components/invalidation/invalidator_state.h" | 10 #include "components/invalidation/invalidator_state.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 | 69 |
70 // Starts sending notifications to |handler|. |handler| must not be NULL, | 70 // Starts sending notifications to |handler|. |handler| must not be NULL, |
71 // and it must not already be registered. | 71 // and it must not already be registered. |
72 // | 72 // |
73 // Handler registrations are persisted across restarts of sync. | 73 // Handler registrations are persisted across restarts of sync. |
74 virtual void RegisterInvalidationHandler( | 74 virtual void RegisterInvalidationHandler( |
75 syncer::InvalidationHandler* handler) = 0; | 75 syncer::InvalidationHandler* handler) = 0; |
76 | 76 |
77 // Updates the set of ObjectIds associated with |handler|. |handler| must | 77 // Updates the set of ObjectIds associated with |handler|. |handler| must |
78 // not be NULL, and must already be registered. An ID must be registered for | 78 // not be NULL, and must already be registered. An ID must be registered for |
79 // at most one handler. | 79 // at most one handler. If ID is already registered function returns false. |
80 // | 80 // |
81 // Registered IDs are persisted across restarts of sync. | 81 // Registered IDs are persisted across restarts of sync. |
82 virtual void UpdateRegisteredInvalidationIds( | 82 virtual bool UpdateRegisteredInvalidationIds( |
83 syncer::InvalidationHandler* handler, | 83 syncer::InvalidationHandler* handler, |
84 const syncer::ObjectIdSet& ids) = 0; | 84 const syncer::ObjectIdSet& ids) WARN_UNUSED_RESULT = 0; |
85 | 85 |
86 // Stops sending notifications to |handler|. |handler| must not be NULL, and | 86 // Stops sending notifications to |handler|. |handler| must not be NULL, and |
87 // it must already be registered. Note that this doesn't unregister the IDs | 87 // it must already be registered. Note that this doesn't unregister the IDs |
88 // associated with |handler|. | 88 // associated with |handler|. |
89 // | 89 // |
90 // Handler registrations are persisted across restarts of sync. | 90 // Handler registrations are persisted across restarts of sync. |
91 virtual void UnregisterInvalidationHandler( | 91 virtual void UnregisterInvalidationHandler( |
92 syncer::InvalidationHandler* handler) = 0; | 92 syncer::InvalidationHandler* handler) = 0; |
93 | 93 |
94 // Returns the current invalidator state. When called from within | 94 // Returns the current invalidator state. When called from within |
(...skipping 12 matching lines...) Expand all Loading... |
107 virtual void RequestDetailedStatus( | 107 virtual void RequestDetailedStatus( |
108 base::Callback<void(const base::DictionaryValue&)> post_caller) const = 0; | 108 base::Callback<void(const base::DictionaryValue&)> post_caller) const = 0; |
109 | 109 |
110 // Returns the identity provider. | 110 // Returns the identity provider. |
111 virtual IdentityProvider* GetIdentityProvider() = 0; | 111 virtual IdentityProvider* GetIdentityProvider() = 0; |
112 }; | 112 }; |
113 | 113 |
114 } // namespace invalidation | 114 } // namespace invalidation |
115 | 115 |
116 #endif // COMPONENTS_INVALIDATION_INVALIDATION_SERVICE_H_ | 116 #endif // COMPONENTS_INVALIDATION_INVALIDATION_SERVICE_H_ |
OLD | NEW |