| 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 #ifndef CHROME_BROWSER_SYNC_INVALIDATION_FRONTEND_H_ | 5 #ifndef CHROME_BROWSER_SYNC_INVALIDATION_FRONTEND_H_ |
| 6 #define CHROME_BROWSER_SYNC_INVALIDATION_FRONTEND_H_ | 6 #define CHROME_BROWSER_SYNC_INVALIDATION_FRONTEND_H_ |
| 7 | 7 |
| 8 #include "sync/notifier/invalidation_util.h" | 8 #include "sync/notifier/invalidation_util.h" |
| 9 #include "sync/notifier/invalidator_state.h" |
| 9 | 10 |
| 10 namespace syncer { | 11 namespace syncer { |
| 11 class InvalidationHandler; | 12 class InvalidationHandler; |
| 13 class AckHandle; |
| 12 } // namespace syncer | 14 } // namespace syncer |
| 13 | 15 |
| 14 // Interface for classes that handle invalidation registrations and send out | 16 // Interface for classes that handle invalidation registrations and send out |
| 15 // invalidations to register handlers. | 17 // invalidations to register handlers. |
| 16 // | 18 // |
| 17 // Invalidation clients should follow the pattern below: | 19 // Invalidation clients should follow the pattern below: |
| 18 // | 20 // |
| 19 // When starting the client: | 21 // When starting the client: |
| 20 // | 22 // |
| 21 // frontend->RegisterInvalidationHandler(client_handler); | 23 // frontend->RegisterInvalidationHandler(client_handler); |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 // Sends an acknowledgement that an invalidation for |id| was successfully | 87 // Sends an acknowledgement that an invalidation for |id| was successfully |
| 86 // handled. | 88 // handled. |
| 87 virtual void AcknowledgeInvalidation(const invalidation::ObjectId& id, | 89 virtual void AcknowledgeInvalidation(const invalidation::ObjectId& id, |
| 88 const syncer::AckHandle& ack_handle) = 0; | 90 const syncer::AckHandle& ack_handle) = 0; |
| 89 | 91 |
| 90 // Returns the current invalidator state. When called from within | 92 // Returns the current invalidator state. When called from within |
| 91 // InvalidationHandler::OnInvalidatorStateChange(), this must return | 93 // InvalidationHandler::OnInvalidatorStateChange(), this must return |
| 92 // the updated state. | 94 // the updated state. |
| 93 virtual syncer::InvalidatorState GetInvalidatorState() const = 0; | 95 virtual syncer::InvalidatorState GetInvalidatorState() const = 0; |
| 94 | 96 |
| 97 // Returns this client's unique ID. Used to prevent this client from |
| 98 // receiving notifications of commits it made itself. |
| 99 virtual std::string GetInvalidatorClientId() const = 0; |
| 100 |
| 95 protected: | 101 protected: |
| 96 virtual ~InvalidationFrontend() { } | 102 virtual ~InvalidationFrontend() { } |
| 97 }; | 103 }; |
| 98 | 104 |
| 99 #endif // CHROME_BROWSER_SYNC_INVALIDATION_FRONTEND_H_ | 105 #endif // CHROME_BROWSER_SYNC_INVALIDATION_FRONTEND_H_ |
| OLD | NEW |