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 | 9 |
10 namespace syncer { | 10 namespace syncer { |
11 class SyncNotifierObserver; | 11 class InvalidationHandler; |
12 } // namespace syncer | 12 } // namespace syncer |
13 | 13 |
14 // Interface for classes that handle invalidation registrations and send out | 14 // Interface for classes that handle invalidation registrations and send out |
15 // invalidations to register handlers. | 15 // invalidations to register handlers. |
16 class InvalidationFrontend { | 16 class InvalidationFrontend { |
17 public: | 17 public: |
18 // Starts sending notifications to |handler|. |handler| must not be NULL, | 18 // Starts sending notifications to |handler|. |handler| must not be NULL, |
19 // and it must not already be registered. | 19 // and it must not already be registered. |
20 // | 20 // |
21 // Handler registrations are persisted across restarts of sync. | 21 // Handler registrations are persisted across restarts of sync. |
22 virtual void RegisterInvalidationHandler( | 22 virtual void RegisterInvalidationHandler( |
23 syncer::SyncNotifierObserver* handler) = 0; | 23 syncer::InvalidationHandler* handler) = 0; |
24 | 24 |
25 // Updates the set of ObjectIds associated with |handler|. |handler| must | 25 // Updates the set of ObjectIds associated with |handler|. |handler| must |
26 // not be NULL, and must already be registered. An ID must be registered for | 26 // not be NULL, and must already be registered. An ID must be registered for |
27 // at most one handler. | 27 // at most one handler. |
28 // | 28 // |
29 // Registered IDs are persisted across restarts of sync. | 29 // Registered IDs are persisted across restarts of sync. |
30 virtual void UpdateRegisteredInvalidationIds( | 30 virtual void UpdateRegisteredInvalidationIds( |
31 syncer::SyncNotifierObserver* handler, | 31 syncer::InvalidationHandler* handler, |
32 const syncer::ObjectIdSet& ids) = 0; | 32 const syncer::ObjectIdSet& ids) = 0; |
33 | 33 |
34 // Stops sending notifications to |handler|. |handler| must not be NULL, and | 34 // Stops sending notifications to |handler|. |handler| must not be NULL, and |
35 // it must already be registered. Note that this doesn't unregister the IDs | 35 // it must already be registered. Note that this doesn't unregister the IDs |
36 // associated with |handler|. | 36 // associated with |handler|. |
37 // | 37 // |
38 // Handler registrations are persisted across restarts of sync. | 38 // Handler registrations are persisted across restarts of sync. |
39 virtual void UnregisterInvalidationHandler( | 39 virtual void UnregisterInvalidationHandler( |
40 syncer::SyncNotifierObserver* handler) = 0; | 40 syncer::InvalidationHandler* handler) = 0; |
41 | 41 |
42 protected: | 42 protected: |
43 virtual ~InvalidationFrontend() { } | 43 virtual ~InvalidationFrontend() { } |
44 }; | 44 }; |
45 | 45 |
46 #endif // CHROME_BROWSER_SYNC_INVALIDATION_FRONTEND_H_ | 46 #endif // CHROME_BROWSER_SYNC_INVALIDATION_FRONTEND_H_ |
OLD | NEW |