| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CHROME_BROWSER_INVALIDATION_INVALIDATION_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_INVALIDATION_INVALIDATION_SERVICE_H_ |
| 6 #define CHROME_BROWSER_INVALIDATION_INVALIDATION_SERVICE_H_ | 6 #define CHROME_BROWSER_INVALIDATION_INVALIDATION_SERVICE_H_ |
| 7 | 7 |
| 8 #include "components/browser_context_keyed_service/browser_context_keyed_service
.h" | 8 #include "components/browser_context_keyed_service/browser_context_keyed_service
.h" |
| 9 #include "sync/notifier/invalidation_util.h" | 9 #include "sync/notifier/invalidation_util.h" |
| 10 #include "sync/notifier/invalidator_state.h" | 10 #include "sync/notifier/invalidator_state.h" |
| 11 | 11 |
| 12 namespace syncer { | 12 namespace syncer { |
| 13 class InvalidationHandler; | 13 class InvalidationHandler; |
| 14 class AckHandle; | |
| 15 } // namespace syncer | 14 } // namespace syncer |
| 16 | 15 |
| 17 namespace invalidation { | 16 namespace invalidation { |
| 18 | 17 |
| 19 // Interface for classes that handle invalidation registrations and send out | 18 // Interface for classes that handle invalidation registrations and send out |
| 20 // invalidations to register handlers. | 19 // invalidations to register handlers. |
| 21 // | 20 // |
| 22 // Invalidation clients should follow the pattern below: | 21 // Invalidation clients should follow the pattern below: |
| 23 // | 22 // |
| 24 // When starting the client: | 23 // When starting the client: |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 const syncer::ObjectIdSet& ids) = 0; | 83 const syncer::ObjectIdSet& ids) = 0; |
| 85 | 84 |
| 86 // Stops sending notifications to |handler|. |handler| must not be NULL, and | 85 // 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 | 86 // it must already be registered. Note that this doesn't unregister the IDs |
| 88 // associated with |handler|. | 87 // associated with |handler|. |
| 89 // | 88 // |
| 90 // Handler registrations are persisted across restarts of sync. | 89 // Handler registrations are persisted across restarts of sync. |
| 91 virtual void UnregisterInvalidationHandler( | 90 virtual void UnregisterInvalidationHandler( |
| 92 syncer::InvalidationHandler* handler) = 0; | 91 syncer::InvalidationHandler* handler) = 0; |
| 93 | 92 |
| 94 // Sends an acknowledgement that an invalidation for |id| was successfully | |
| 95 // handled. | |
| 96 virtual void AcknowledgeInvalidation(const invalidation::ObjectId& id, | |
| 97 const syncer::AckHandle& ack_handle) = 0; | |
| 98 | |
| 99 // Returns the current invalidator state. When called from within | 93 // Returns the current invalidator state. When called from within |
| 100 // InvalidationHandler::OnInvalidatorStateChange(), this must return | 94 // InvalidationHandler::OnInvalidatorStateChange(), this must return |
| 101 // the updated state. | 95 // the updated state. |
| 102 virtual syncer::InvalidatorState GetInvalidatorState() const = 0; | 96 virtual syncer::InvalidatorState GetInvalidatorState() const = 0; |
| 103 | 97 |
| 104 // Returns the ID belonging to this invalidation client. Can be used to | 98 // Returns the ID belonging to this invalidation client. Can be used to |
| 105 // prevent the receipt of notifications of our own changes. | 99 // prevent the receipt of notifications of our own changes. |
| 106 virtual std::string GetInvalidatorClientId() const = 0; | 100 virtual std::string GetInvalidatorClientId() const = 0; |
| 107 | 101 |
| 108 protected: | 102 protected: |
| 109 virtual ~InvalidationService() { } | 103 virtual ~InvalidationService() { } |
| 110 }; | 104 }; |
| 111 | 105 |
| 112 } // namespace invalidation | 106 } // namespace invalidation |
| 113 | 107 |
| 114 #endif // CHROME_BROWSER_INVALIDATION_INVALIDATION_SERVICE_H_ | 108 #endif // CHROME_BROWSER_INVALIDATION_INVALIDATION_SERVICE_H_ |
| OLD | NEW |