| 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 Invalidator that wraps an invalidation | 5 // An implementation of Invalidator that wraps an invalidation |
| 6 // client. Handles the details of connecting to XMPP and hooking it | 6 // client. Handles the details of connecting to XMPP and hooking it |
| 7 // up to the invalidation client. | 7 // up to the invalidation client. |
| 8 // | 8 // |
| 9 // You probably don't want to use this directly; use | 9 // You probably don't want to use this directly; use |
| 10 // NonBlockingInvalidator. | 10 // NonBlockingInvalidator. |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 InvalidationNotifier( | 43 InvalidationNotifier( |
| 44 scoped_ptr<SyncNetworkChannel> network_channel, | 44 scoped_ptr<SyncNetworkChannel> network_channel, |
| 45 const std::string& invalidator_client_id, | 45 const std::string& invalidator_client_id, |
| 46 const UnackedInvalidationsMap& saved_invalidations, | 46 const UnackedInvalidationsMap& saved_invalidations, |
| 47 const std::string& invalidation_bootstrap_data, | 47 const std::string& invalidation_bootstrap_data, |
| 48 const base::WeakPtr<InvalidationStateTracker>& invalidation_state_tracker, | 48 const base::WeakPtr<InvalidationStateTracker>& invalidation_state_tracker, |
| 49 scoped_refptr<base::SingleThreadTaskRunner> | 49 scoped_refptr<base::SingleThreadTaskRunner> |
| 50 invalidation_state_tracker_task_runner, | 50 invalidation_state_tracker_task_runner, |
| 51 const std::string& client_info); | 51 const std::string& client_info); |
| 52 | 52 |
| 53 virtual ~InvalidationNotifier(); | 53 ~InvalidationNotifier() override; |
| 54 | 54 |
| 55 // Invalidator implementation. | 55 // Invalidator implementation. |
| 56 virtual void RegisterHandler(InvalidationHandler* handler) override; | 56 void RegisterHandler(InvalidationHandler* handler) override; |
| 57 virtual void UpdateRegisteredIds(InvalidationHandler* handler, | 57 void UpdateRegisteredIds(InvalidationHandler* handler, |
| 58 const ObjectIdSet& ids) override; | 58 const ObjectIdSet& ids) override; |
| 59 virtual void UnregisterHandler(InvalidationHandler* handler) override; | 59 void UnregisterHandler(InvalidationHandler* handler) override; |
| 60 virtual InvalidatorState GetInvalidatorState() const override; | 60 InvalidatorState GetInvalidatorState() const override; |
| 61 virtual void UpdateCredentials( | 61 void UpdateCredentials(const std::string& email, |
| 62 const std::string& email, const std::string& token) override; | 62 const std::string& token) override; |
| 63 virtual void RequestDetailedStatus( | 63 void RequestDetailedStatus(base::Callback<void(const base::DictionaryValue&)> |
| 64 base::Callback<void(const base::DictionaryValue&)> callback) const | 64 callback) const override; |
| 65 override; | |
| 66 | 65 |
| 67 // SyncInvalidationListener::Delegate implementation. | 66 // SyncInvalidationListener::Delegate implementation. |
| 68 virtual void OnInvalidate( | 67 void OnInvalidate(const ObjectIdInvalidationMap& invalidation_map) override; |
| 69 const ObjectIdInvalidationMap& invalidation_map) override; | 68 void OnInvalidatorStateChange(InvalidatorState state) override; |
| 70 virtual void OnInvalidatorStateChange(InvalidatorState state) override; | |
| 71 | 69 |
| 72 private: | 70 private: |
| 73 // We start off in the STOPPED state. When we get our initial | 71 // We start off in the STOPPED state. When we get our initial |
| 74 // credentials, we connect and move to the CONNECTING state. When | 72 // credentials, we connect and move to the CONNECTING state. When |
| 75 // we're connected we start the invalidation client and move to the | 73 // we're connected we start the invalidation client and move to the |
| 76 // STARTED state. We never go back to a previous state. | 74 // STARTED state. We never go back to a previous state. |
| 77 enum State { | 75 enum State { |
| 78 STOPPED, | 76 STOPPED, |
| 79 CONNECTING, | 77 CONNECTING, |
| 80 STARTED | 78 STARTED |
| (...skipping 21 matching lines...) Expand all Loading... |
| 102 | 100 |
| 103 // The invalidation listener. | 101 // The invalidation listener. |
| 104 SyncInvalidationListener invalidation_listener_; | 102 SyncInvalidationListener invalidation_listener_; |
| 105 | 103 |
| 106 DISALLOW_COPY_AND_ASSIGN(InvalidationNotifier); | 104 DISALLOW_COPY_AND_ASSIGN(InvalidationNotifier); |
| 107 }; | 105 }; |
| 108 | 106 |
| 109 } // namespace syncer | 107 } // namespace syncer |
| 110 | 108 |
| 111 #endif // COMPONENTS_INVALIDATION_INVALIDATION_NOTIFIER_H_ | 109 #endif // COMPONENTS_INVALIDATION_INVALIDATION_NOTIFIER_H_ |
| OLD | NEW |