OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 | 71 |
72 // Acknowledge that an invalidation for |id| was handled. | 72 // Acknowledge that an invalidation for |id| was handled. |
73 virtual void Acknowledge(const invalidation::ObjectId& id, | 73 virtual void Acknowledge(const invalidation::ObjectId& id, |
74 const AckHandle& ack_handle) = 0; | 74 const AckHandle& ack_handle) = 0; |
75 | 75 |
76 // Returns the current invalidator state. When called from within | 76 // Returns the current invalidator state. When called from within |
77 // InvalidationHandler::OnInvalidatorStateChange(), this must return | 77 // InvalidationHandler::OnInvalidatorStateChange(), this must return |
78 // the updated state. | 78 // the updated state. |
79 virtual InvalidatorState GetInvalidatorState() const = 0; | 79 virtual InvalidatorState GetInvalidatorState() const = 0; |
80 | 80 |
81 // SetUniqueId must be called once, before any call to | |
82 // UpdateCredentials. |unique_id| should be a non-empty globally | |
83 // unique string. | |
84 virtual void SetUniqueId(const std::string& unique_id) = 0; | |
85 | |
86 // The observers won't be notified of any notifications until | 81 // The observers won't be notified of any notifications until |
87 // UpdateCredentials is called at least once. It can be called more than | 82 // UpdateCredentials is called at least once. It can be called more than |
88 // once. | 83 // once. |
89 virtual void UpdateCredentials( | 84 virtual void UpdateCredentials( |
90 const std::string& email, const std::string& token) = 0; | 85 const std::string& email, const std::string& token) = 0; |
91 | 86 |
92 // This is here only to support the old p2p notification implementation, | 87 // This is here only to support the old p2p notification implementation, |
93 // which is still used by sync integration tests. | 88 // which is still used by sync integration tests. |
94 // TODO(akalin): Remove this once we move the integration tests off p2p | 89 // TODO(akalin): Remove this once we move the integration tests off p2p |
95 // notifications. | 90 // notifications. |
96 virtual void SendInvalidation( | 91 virtual void SendInvalidation( |
97 const ObjectIdInvalidationMap& invalidation_map) = 0; | 92 const ObjectIdInvalidationMap& invalidation_map) = 0; |
98 }; | 93 }; |
99 } // namespace syncer | 94 } // namespace syncer |
100 | 95 |
101 #endif // SYNC_NOTIFIER_INVALIDATOR_H_ | 96 #endif // SYNC_NOTIFIER_INVALIDATOR_H_ |
OLD | NEW |