OLD | NEW |
---|---|
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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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. |
63 virtual void UpdateRegisteredIds(InvalidationHandler* handler, | 63 virtual void UpdateRegisteredIds(InvalidationHandler* handler, |
64 const ObjectIdSet& ids) = 0; | 64 const ObjectIdSet& ids) = 0; |
65 | 65 |
66 // Stops sending notifications to |handler|. |handler| must not be NULL, and | 66 // 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 | 67 // it must already be registered. Note that this doesn't unregister the IDs |
68 // associated with |handler|. | 68 // associated with |handler|. |
69 virtual void UnregisterHandler(InvalidationHandler* handler) = 0; | 69 virtual void UnregisterHandler(InvalidationHandler* handler) = 0; |
70 | 70 |
71 // TODO(dcheng): Add comment. | |
akalin
2012/10/19 13:27:16
!
dcheng
2012/10/19 19:38:11
Done.
| |
72 virtual void Acknowledge(const invalidation::ObjectId& id, | |
73 const AckHandle& ack_handle) = 0; | |
74 | |
71 // Returns the current invalidator state. When called from within | 75 // Returns the current invalidator state. When called from within |
72 // InvalidationHandler::OnInvalidatorStateChange(), this must return | 76 // InvalidationHandler::OnInvalidatorStateChange(), this must return |
73 // the updated state. | 77 // the updated state. |
74 virtual InvalidatorState GetInvalidatorState() const = 0; | 78 virtual InvalidatorState GetInvalidatorState() const = 0; |
75 | 79 |
76 // SetUniqueId must be called once, before any call to | 80 // SetUniqueId must be called once, before any call to |
77 // UpdateCredentials. |unique_id| should be a non-empty globally | 81 // UpdateCredentials. |unique_id| should be a non-empty globally |
78 // unique string. | 82 // unique string. |
79 virtual void SetUniqueId(const std::string& unique_id) = 0; | 83 virtual void SetUniqueId(const std::string& unique_id) = 0; |
80 | 84 |
(...skipping 11 matching lines...) Expand all Loading... | |
92 // This is here only to support the old p2p notification implementation, | 96 // This is here only to support the old p2p notification implementation, |
93 // which is still used by sync integration tests. | 97 // which is still used by sync integration tests. |
94 // TODO(akalin): Remove this once we move the integration tests off p2p | 98 // TODO(akalin): Remove this once we move the integration tests off p2p |
95 // notifications. | 99 // notifications. |
96 virtual void SendInvalidation( | 100 virtual void SendInvalidation( |
97 const ObjectIdInvalidationMap& invalidation_map) = 0; | 101 const ObjectIdInvalidationMap& invalidation_map) = 0; |
98 }; | 102 }; |
99 } // namespace syncer | 103 } // namespace syncer |
100 | 104 |
101 #endif // SYNC_NOTIFIER_INVALIDATOR_H_ | 105 #endif // SYNC_NOTIFIER_INVALIDATOR_H_ |
OLD | NEW |