| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_INVALIDATION_IMPL_NON_BLOCKING_INVALIDATOR_H_ | 8 #ifndef COMPONENTS_INVALIDATION_IMPL_NON_BLOCKING_INVALIDATOR_H_ |
| 9 #define COMPONENTS_INVALIDATION_IMPL_NON_BLOCKING_INVALIDATOR_H_ | 9 #define COMPONENTS_INVALIDATION_IMPL_NON_BLOCKING_INVALIDATOR_H_ |
| 10 | 10 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 namespace syncer { | 30 namespace syncer { |
| 31 class SyncNetworkChannel; | 31 class SyncNetworkChannel; |
| 32 class GCMNetworkChannelDelegate; | 32 class GCMNetworkChannelDelegate; |
| 33 | 33 |
| 34 // Callback type for function that creates SyncNetworkChannel. This function | 34 // Callback type for function that creates SyncNetworkChannel. This function |
| 35 // gets passed into NonBlockingInvalidator constructor. | 35 // gets passed into NonBlockingInvalidator constructor. |
| 36 typedef base::Callback<scoped_ptr<SyncNetworkChannel>(void)> | 36 typedef base::Callback<scoped_ptr<SyncNetworkChannel>(void)> |
| 37 NetworkChannelCreator; | 37 NetworkChannelCreator; |
| 38 | 38 |
| 39 class INVALIDATION_EXPORT_PRIVATE NonBlockingInvalidator | 39 class INVALIDATION_EXPORT NonBlockingInvalidator |
| 40 : public Invalidator, | 40 : public Invalidator, |
| 41 public InvalidationStateTracker { | 41 public InvalidationStateTracker { |
| 42 public: | 42 public: |
| 43 // |invalidation_state_tracker| must be initialized and must outlive |this|. | 43 // |invalidation_state_tracker| must be initialized and must outlive |this|. |
| 44 NonBlockingInvalidator( | 44 NonBlockingInvalidator( |
| 45 NetworkChannelCreator network_channel_creator, | 45 NetworkChannelCreator network_channel_creator, |
| 46 const std::string& invalidator_client_id, | 46 const std::string& invalidator_client_id, |
| 47 const UnackedInvalidationsMap& saved_invalidations, | 47 const UnackedInvalidationsMap& saved_invalidations, |
| 48 const std::string& invalidation_bootstrap_data, | 48 const std::string& invalidation_bootstrap_data, |
| 49 InvalidationStateTracker* invalidation_state_tracker, | 49 InvalidationStateTracker* invalidation_state_tracker, |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner_; | 103 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner_; |
| 104 | 104 |
| 105 base::WeakPtrFactory<NonBlockingInvalidator> weak_ptr_factory_; | 105 base::WeakPtrFactory<NonBlockingInvalidator> weak_ptr_factory_; |
| 106 | 106 |
| 107 DISALLOW_COPY_AND_ASSIGN(NonBlockingInvalidator); | 107 DISALLOW_COPY_AND_ASSIGN(NonBlockingInvalidator); |
| 108 }; | 108 }; |
| 109 | 109 |
| 110 } // namespace syncer | 110 } // namespace syncer |
| 111 | 111 |
| 112 #endif // COMPONENTS_INVALIDATION_IMPL_NON_BLOCKING_INVALIDATOR_H_ | 112 #endif // COMPONENTS_INVALIDATION_IMPL_NON_BLOCKING_INVALIDATOR_H_ |
| OLD | NEW |