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 // A simple wrapper around invalidation::InvalidationClient that | 5 // A simple wrapper around invalidation::InvalidationClient that |
6 // handles all the startup/shutdown details and hookups. | 6 // handles all the startup/shutdown details and hookups. |
7 | 7 |
8 #ifndef SYNC_NOTIFIER_SYNC_INVALIDATION_LISTENER_H_ | 8 #ifndef COMPONENTS_INVALIDATION_SYNC_INVALIDATION_LISTENER_H_ |
9 #define SYNC_NOTIFIER_SYNC_INVALIDATION_LISTENER_H_ | 9 #define COMPONENTS_INVALIDATION_SYNC_INVALIDATION_LISTENER_H_ |
10 | 10 |
11 #include <string> | 11 #include <string> |
12 | 12 |
13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
14 #include "base/callback_forward.h" | 14 #include "base/callback_forward.h" |
15 #include "base/compiler_specific.h" | 15 #include "base/compiler_specific.h" |
16 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
17 #include "base/memory/weak_ptr.h" | 17 #include "base/memory/weak_ptr.h" |
18 #include "base/threading/non_thread_safe.h" | 18 #include "base/threading/non_thread_safe.h" |
| 19 #include "components/invalidation/invalidation_export.h" |
| 20 #include "components/invalidation/state_writer.h" |
| 21 #include "components/invalidation/sync_system_resources.h" |
19 #include "google/cacheinvalidation/include/invalidation-listener.h" | 22 #include "google/cacheinvalidation/include/invalidation-listener.h" |
20 #include "sync/base/sync_export.h" | 23 #include "sync/internal_api/public/base/invalidator_state.h" |
21 #include "sync/internal_api/public/util/weak_handle.h" | 24 #include "sync/internal_api/public/util/weak_handle.h" |
22 #include "sync/notifier/ack_handler.h" | 25 #include "sync/notifier/ack_handler.h" |
23 #include "sync/notifier/invalidation_state_tracker.h" | 26 #include "sync/notifier/invalidation_state_tracker.h" |
24 #include "sync/notifier/invalidator_state.h" | |
25 #include "sync/notifier/state_writer.h" | |
26 #include "sync/notifier/sync_system_resources.h" | |
27 #include "sync/notifier/unacked_invalidation_set.h" | 27 #include "sync/notifier/unacked_invalidation_set.h" |
28 | 28 |
29 namespace buzz { | 29 namespace buzz { |
30 class XmppTaskParentInterface; | 30 class XmppTaskParentInterface; |
31 } // namespace buzz | 31 } // namespace buzz |
32 | 32 |
33 namespace notifier { | 33 namespace notifier { |
34 class PushClient; | 34 class PushClient; |
35 } // namespace notifier | 35 } // namespace notifier |
36 | 36 |
37 namespace syncer { | 37 namespace syncer { |
38 | 38 |
39 class ObjectIdInvalidationMap; | 39 class ObjectIdInvalidationMap; |
40 class RegistrationManager; | 40 class RegistrationManager; |
41 | 41 |
42 // SyncInvalidationListener is not thread-safe and lives on the sync | 42 // SyncInvalidationListener is not thread-safe and lives on the sync |
43 // thread. | 43 // thread. |
44 class SYNC_EXPORT_PRIVATE SyncInvalidationListener | 44 class INVALIDATION_EXPORT_PRIVATE SyncInvalidationListener |
45 : public NON_EXPORTED_BASE(invalidation::InvalidationListener), | 45 : public NON_EXPORTED_BASE(invalidation::InvalidationListener), |
46 public StateWriter, | 46 public StateWriter, |
47 public SyncNetworkChannel::Observer, | 47 public SyncNetworkChannel::Observer, |
48 public AckHandler, | 48 public AckHandler, |
49 public base::NonThreadSafe { | 49 public base::NonThreadSafe { |
50 public: | 50 public: |
51 typedef base::Callback<invalidation::InvalidationClient*( | 51 typedef base::Callback<invalidation::InvalidationClient*( |
52 invalidation::SystemResources*, | 52 invalidation::SystemResources*, |
53 int, | 53 int, |
54 const invalidation::string&, | 54 const invalidation::string&, |
55 const invalidation::string&, | 55 const invalidation::string&, |
56 invalidation::InvalidationListener*)> CreateInvalidationClientCallback; | 56 invalidation::InvalidationListener*)> CreateInvalidationClientCallback; |
57 | 57 |
58 class SYNC_EXPORT_PRIVATE Delegate { | 58 class INVALIDATION_EXPORT_PRIVATE Delegate { |
59 public: | 59 public: |
60 virtual ~Delegate(); | 60 virtual ~Delegate(); |
61 | 61 |
62 virtual void OnInvalidate( | 62 virtual void OnInvalidate( |
63 const ObjectIdInvalidationMap& invalidations) = 0; | 63 const ObjectIdInvalidationMap& invalidations) = 0; |
64 | 64 |
65 virtual void OnInvalidatorStateChange(InvalidatorState state) = 0; | 65 virtual void OnInvalidatorStateChange(InvalidatorState state) = 0; |
66 }; | 66 }; |
67 | 67 |
68 explicit SyncInvalidationListener( | 68 explicit SyncInvalidationListener( |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 InvalidatorState ticl_state_; | 186 InvalidatorState ticl_state_; |
187 InvalidatorState push_client_state_; | 187 InvalidatorState push_client_state_; |
188 | 188 |
189 base::WeakPtrFactory<SyncInvalidationListener> weak_ptr_factory_; | 189 base::WeakPtrFactory<SyncInvalidationListener> weak_ptr_factory_; |
190 | 190 |
191 DISALLOW_COPY_AND_ASSIGN(SyncInvalidationListener); | 191 DISALLOW_COPY_AND_ASSIGN(SyncInvalidationListener); |
192 }; | 192 }; |
193 | 193 |
194 } // namespace syncer | 194 } // namespace syncer |
195 | 195 |
196 #endif // SYNC_NOTIFIER_SYNC_INVALIDATION_LISTENER_H_ | 196 #endif // COMPONENTS_INVALIDATION_SYNC_INVALIDATION_LISTENER_H_ |
OLD | NEW |