| 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_INVALIDATION_NOTIFIER_H_ | 8 #ifndef SYNC_NOTIFIER_NON_BLOCKING_INVALIDATION_NOTIFIER_H_ |
| 9 #define SYNC_NOTIFIER_NON_BLOCKING_INVALIDATION_NOTIFIER_H_ | 9 #define SYNC_NOTIFIER_NON_BLOCKING_INVALIDATION_NOTIFIER_H_ |
| 10 | 10 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 virtual void SetStateDeprecated(const std::string& state) OVERRIDE; | 54 virtual void SetStateDeprecated(const std::string& state) OVERRIDE; |
| 55 virtual void UpdateCredentials( | 55 virtual void UpdateCredentials( |
| 56 const std::string& email, const std::string& token) OVERRIDE; | 56 const std::string& email, const std::string& token) OVERRIDE; |
| 57 virtual void SendNotification(ModelTypeSet changed_types) OVERRIDE; | 57 virtual void SendNotification(ModelTypeSet changed_types) OVERRIDE; |
| 58 | 58 |
| 59 // SyncNotifierObserver implementation. | 59 // SyncNotifierObserver implementation. |
| 60 virtual void OnNotificationsEnabled() OVERRIDE; | 60 virtual void OnNotificationsEnabled() OVERRIDE; |
| 61 virtual void OnNotificationsDisabled( | 61 virtual void OnNotificationsDisabled( |
| 62 NotificationsDisabledReason reason) OVERRIDE; | 62 NotificationsDisabledReason reason) OVERRIDE; |
| 63 virtual void OnIncomingNotification( | 63 virtual void OnIncomingNotification( |
| 64 const ObjectIdPayloadMap& id_payloads, | 64 const ObjectIdStateMap& id_state_map, |
| 65 IncomingNotificationSource source) OVERRIDE; | 65 IncomingNotificationSource source) OVERRIDE; |
| 66 | 66 |
| 67 private: | 67 private: |
| 68 class Core; | 68 class Core; |
| 69 | 69 |
| 70 base::WeakPtrFactory<NonBlockingInvalidationNotifier> weak_ptr_factory_; | 70 base::WeakPtrFactory<NonBlockingInvalidationNotifier> weak_ptr_factory_; |
| 71 | 71 |
| 72 SyncNotifierRegistrar registrar_; | 72 SyncNotifierRegistrar registrar_; |
| 73 | 73 |
| 74 // The real guts of NonBlockingInvalidationNotifier, which allows | 74 // The real guts of NonBlockingInvalidationNotifier, which allows |
| 75 // this class to live completely on the parent thread. | 75 // this class to live completely on the parent thread. |
| 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(NonBlockingInvalidationNotifier); | 80 DISALLOW_COPY_AND_ASSIGN(NonBlockingInvalidationNotifier); |
| 81 }; | 81 }; |
| 82 | 82 |
| 83 } // namespace syncer | 83 } // namespace syncer |
| 84 | 84 |
| 85 #endif // SYNC_NOTIFIER_NON_BLOCKING_INVALIDATION_NOTIFIER_H_ | 85 #endif // SYNC_NOTIFIER_NON_BLOCKING_INVALIDATION_NOTIFIER_H_ |
| OLD | NEW |