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 // An implementation of SyncNotifier that wraps InvalidationNotifier | 5 // An implementation of SyncNotifier that wraps InvalidationNotifier |
6 // on its own thread. | 6 // on its own thread. |
7 | 7 |
8 #ifndef SYNC_NOTIFIER_NON_BLOCKING_INVALIDATOR_H_ | 8 #ifndef SYNC_NOTIFIER_NON_BLOCKING_INVALIDATOR_H_ |
9 #define SYNC_NOTIFIER_NON_BLOCKING_INVALIDATOR_H_ | 9 #define SYNC_NOTIFIER_NON_BLOCKING_INVALIDATOR_H_ |
10 | 10 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 // Invalidator implementation. | 50 // Invalidator implementation. |
51 virtual void RegisterHandler(InvalidationHandler* handler) OVERRIDE; | 51 virtual void RegisterHandler(InvalidationHandler* handler) OVERRIDE; |
52 virtual void UpdateRegisteredIds(InvalidationHandler* handler, | 52 virtual void UpdateRegisteredIds(InvalidationHandler* handler, |
53 const ObjectIdSet& ids) OVERRIDE; | 53 const ObjectIdSet& ids) OVERRIDE; |
54 virtual void UnregisterHandler(InvalidationHandler* handler) OVERRIDE; | 54 virtual void UnregisterHandler(InvalidationHandler* handler) OVERRIDE; |
55 virtual void Acknowledge(const invalidation::ObjectId& id, | 55 virtual void Acknowledge(const invalidation::ObjectId& id, |
56 const AckHandle& ack_handle) OVERRIDE; | 56 const AckHandle& ack_handle) OVERRIDE; |
57 virtual InvalidatorState GetInvalidatorState() const OVERRIDE; | 57 virtual InvalidatorState GetInvalidatorState() const OVERRIDE; |
58 virtual void UpdateCredentials( | 58 virtual void UpdateCredentials( |
59 const std::string& email, const std::string& token) OVERRIDE; | 59 const std::string& email, const std::string& token) OVERRIDE; |
60 virtual void SendInvalidation( | |
61 const ObjectIdInvalidationMap& invalidation_map) OVERRIDE; | |
62 | 60 |
63 // InvalidationHandler implementation. | 61 // InvalidationHandler implementation. |
64 virtual void OnInvalidatorStateChange(InvalidatorState state) OVERRIDE; | 62 virtual void OnInvalidatorStateChange(InvalidatorState state) OVERRIDE; |
65 virtual void OnIncomingInvalidation( | 63 virtual void OnIncomingInvalidation( |
66 const ObjectIdInvalidationMap& invalidation_map) OVERRIDE; | 64 const ObjectIdInvalidationMap& invalidation_map) OVERRIDE; |
67 | 65 |
68 private: | 66 private: |
69 class Core; | 67 class Core; |
70 | 68 |
71 base::WeakPtrFactory<NonBlockingInvalidator> weak_ptr_factory_; | 69 base::WeakPtrFactory<NonBlockingInvalidator> weak_ptr_factory_; |
72 | 70 |
73 InvalidatorRegistrar registrar_; | 71 InvalidatorRegistrar registrar_; |
74 | 72 |
75 // The real guts of NonBlockingInvalidator, which allows this class to live | 73 // The real guts of NonBlockingInvalidator, which allows this class to live |
76 // completely on the parent thread. | 74 // completely on the parent thread. |
77 scoped_refptr<Core> core_; | 75 scoped_refptr<Core> core_; |
78 scoped_refptr<base::SingleThreadTaskRunner> parent_task_runner_; | 76 scoped_refptr<base::SingleThreadTaskRunner> parent_task_runner_; |
79 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner_; | 77 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner_; |
80 | 78 |
81 DISALLOW_COPY_AND_ASSIGN(NonBlockingInvalidator); | 79 DISALLOW_COPY_AND_ASSIGN(NonBlockingInvalidator); |
82 }; | 80 }; |
83 | 81 |
84 } // namespace syncer | 82 } // namespace syncer |
85 | 83 |
86 #endif // SYNC_NOTIFIER_NON_BLOCKING_INVALIDATOR_H_ | 84 #endif // SYNC_NOTIFIER_NON_BLOCKING_INVALIDATOR_H_ |
OLD | NEW |