| 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 // 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 19 matching lines...) Expand all Loading... |
| 30 // TODO(akalin): Generalize the interface so it can use any Invalidator. | 30 // TODO(akalin): Generalize the interface so it can use any Invalidator. |
| 31 // (http://crbug.com/140409). | 31 // (http://crbug.com/140409). |
| 32 class NonBlockingInvalidator | 32 class NonBlockingInvalidator |
| 33 : public Invalidator, | 33 : public Invalidator, |
| 34 // InvalidationHandler to "observe" our Core via WeakHandle. | 34 // InvalidationHandler to "observe" our Core via WeakHandle. |
| 35 public InvalidationHandler { | 35 public InvalidationHandler { |
| 36 public: | 36 public: |
| 37 // |invalidation_state_tracker| must be initialized. | 37 // |invalidation_state_tracker| must be initialized. |
| 38 NonBlockingInvalidator( | 38 NonBlockingInvalidator( |
| 39 const notifier::NotifierOptions& notifier_options, | 39 const notifier::NotifierOptions& notifier_options, |
| 40 const InvalidationVersionMap& initial_max_invalidation_versions, | 40 const InvalidationStateMap& initial_invalidation_state_map, |
| 41 const std::string& invalidation_bootstrap_data, | 41 const std::string& invalidation_bootstrap_data, |
| 42 const WeakHandle<InvalidationStateTracker>& | 42 const WeakHandle<InvalidationStateTracker>& |
| 43 invalidation_state_tracker, | 43 invalidation_state_tracker, |
| 44 const std::string& client_info); | 44 const std::string& client_info); |
| 45 | 45 |
| 46 virtual ~NonBlockingInvalidator(); | 46 virtual ~NonBlockingInvalidator(); |
| 47 | 47 |
| 48 // Invalidator implementation. | 48 // Invalidator implementation. |
| 49 virtual void RegisterHandler(InvalidationHandler* handler) OVERRIDE; | 49 virtual void RegisterHandler(InvalidationHandler* handler) OVERRIDE; |
| 50 virtual void UpdateRegisteredIds(InvalidationHandler* handler, | 50 virtual void UpdateRegisteredIds(InvalidationHandler* handler, |
| (...skipping 25 matching lines...) Expand all Loading... |
| 76 scoped_refptr<Core> core_; | 76 scoped_refptr<Core> core_; |
| 77 scoped_refptr<base::SingleThreadTaskRunner> parent_task_runner_; | 77 scoped_refptr<base::SingleThreadTaskRunner> parent_task_runner_; |
| 78 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner_; | 78 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner_; |
| 79 | 79 |
| 80 DISALLOW_COPY_AND_ASSIGN(NonBlockingInvalidator); | 80 DISALLOW_COPY_AND_ASSIGN(NonBlockingInvalidator); |
| 81 }; | 81 }; |
| 82 | 82 |
| 83 } // namespace syncer | 83 } // namespace syncer |
| 84 | 84 |
| 85 #endif // SYNC_NOTIFIER_NON_BLOCKING_INVALIDATOR_H_ | 85 #endif // SYNC_NOTIFIER_NON_BLOCKING_INVALIDATOR_H_ |
| OLD | NEW |