| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 // not be NULL, and must already be registered. An ID must be registered for | 57 // not be NULL, and must already be registered. An ID must be registered for |
| 58 // at most one handler. | 58 // at most one handler. |
| 59 virtual void UpdateRegisteredIds(InvalidationHandler* handler, | 59 virtual void UpdateRegisteredIds(InvalidationHandler* handler, |
| 60 const ObjectIdSet& ids) = 0; | 60 const ObjectIdSet& ids) = 0; |
| 61 | 61 |
| 62 // Stops sending notifications to |handler|. |handler| must not be NULL, and | 62 // Stops sending notifications to |handler|. |handler| must not be NULL, and |
| 63 // it must already be registered. Note that this doesn't unregister the IDs | 63 // it must already be registered. Note that this doesn't unregister the IDs |
| 64 // associated with |handler|. | 64 // associated with |handler|. |
| 65 virtual void UnregisterHandler(InvalidationHandler* handler) = 0; | 65 virtual void UnregisterHandler(InvalidationHandler* handler) = 0; |
| 66 | 66 |
| 67 // TODO(dcheng): Add comment. |
| 68 virtual void Acknowledge(const invalidation::ObjectId& id, |
| 69 const AckHandle& ack_handle) = 0; |
| 70 |
| 67 // Returns the current invalidator state. When called from within | 71 // Returns the current invalidator state. When called from within |
| 68 // InvalidationHandler::OnInvalidatorStateChange(), this must return | 72 // InvalidationHandler::OnInvalidatorStateChange(), this must return |
| 69 // the updated state. | 73 // the updated state. |
| 70 virtual InvalidatorState GetInvalidatorState() const = 0; | 74 virtual InvalidatorState GetInvalidatorState() const = 0; |
| 71 | 75 |
| 72 // SetUniqueId must be called once, before any call to | 76 // SetUniqueId must be called once, before any call to |
| 73 // UpdateCredentials. |unique_id| should be a non-empty globally | 77 // UpdateCredentials. |unique_id| should be a non-empty globally |
| 74 // unique string. | 78 // unique string. |
| 75 virtual void SetUniqueId(const std::string& unique_id) = 0; | 79 virtual void SetUniqueId(const std::string& unique_id) = 0; |
| 76 | 80 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 87 | 91 |
| 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(const ObjectIdStateMap& id_state_map) = 0; | 96 virtual void SendInvalidation(const ObjectIdStateMap& id_state_map) = 0; |
| 93 }; | 97 }; |
| 94 } // namespace syncer | 98 } // namespace syncer |
| 95 | 99 |
| 96 #endif // SYNC_NOTIFIER_INVALIDATOR_H_ | 100 #endif // SYNC_NOTIFIER_INVALIDATOR_H_ |
| OLD | NEW |