| 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 // A simple wrapper around invalidation::InvalidationClient that | 5 // A simple wrapper around invalidation::InvalidationClient that |
| 6 // handles all the startup/shutdown details and hookups. | 6 // handles all the startup/shutdown details and hookups. |
| 7 | 7 |
| 8 #ifndef COMPONENTS_INVALIDATION_SYNC_INVALIDATION_LISTENER_H_ | 8 #ifndef COMPONENTS_INVALIDATION_SYNC_INVALIDATION_LISTENER_H_ |
| 9 #define COMPONENTS_INVALIDATION_SYNC_INVALIDATION_LISTENER_H_ | 9 #define COMPONENTS_INVALIDATION_SYNC_INVALIDATION_LISTENER_H_ |
| 10 | 10 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 Delegate* delegate); | 85 Delegate* delegate); |
| 86 | 86 |
| 87 void UpdateCredentials(const std::string& email, const std::string& token); | 87 void UpdateCredentials(const std::string& email, const std::string& token); |
| 88 | 88 |
| 89 // Update the set of object IDs that we're interested in getting | 89 // Update the set of object IDs that we're interested in getting |
| 90 // notifications for. May be called at any time. | 90 // notifications for. May be called at any time. |
| 91 void UpdateRegisteredIds(const ObjectIdSet& ids); | 91 void UpdateRegisteredIds(const ObjectIdSet& ids); |
| 92 | 92 |
| 93 // invalidation::InvalidationListener implementation. | 93 // invalidation::InvalidationListener implementation. |
| 94 virtual void Ready( | 94 virtual void Ready( |
| 95 invalidation::InvalidationClient* client) OVERRIDE; | 95 invalidation::InvalidationClient* client) override; |
| 96 virtual void Invalidate( | 96 virtual void Invalidate( |
| 97 invalidation::InvalidationClient* client, | 97 invalidation::InvalidationClient* client, |
| 98 const invalidation::Invalidation& invalidation, | 98 const invalidation::Invalidation& invalidation, |
| 99 const invalidation::AckHandle& ack_handle) OVERRIDE; | 99 const invalidation::AckHandle& ack_handle) override; |
| 100 virtual void InvalidateUnknownVersion( | 100 virtual void InvalidateUnknownVersion( |
| 101 invalidation::InvalidationClient* client, | 101 invalidation::InvalidationClient* client, |
| 102 const invalidation::ObjectId& object_id, | 102 const invalidation::ObjectId& object_id, |
| 103 const invalidation::AckHandle& ack_handle) OVERRIDE; | 103 const invalidation::AckHandle& ack_handle) override; |
| 104 virtual void InvalidateAll( | 104 virtual void InvalidateAll( |
| 105 invalidation::InvalidationClient* client, | 105 invalidation::InvalidationClient* client, |
| 106 const invalidation::AckHandle& ack_handle) OVERRIDE; | 106 const invalidation::AckHandle& ack_handle) override; |
| 107 virtual void InformRegistrationStatus( | 107 virtual void InformRegistrationStatus( |
| 108 invalidation::InvalidationClient* client, | 108 invalidation::InvalidationClient* client, |
| 109 const invalidation::ObjectId& object_id, | 109 const invalidation::ObjectId& object_id, |
| 110 invalidation::InvalidationListener::RegistrationState reg_state) OVERRIDE; | 110 invalidation::InvalidationListener::RegistrationState reg_state) override; |
| 111 virtual void InformRegistrationFailure( | 111 virtual void InformRegistrationFailure( |
| 112 invalidation::InvalidationClient* client, | 112 invalidation::InvalidationClient* client, |
| 113 const invalidation::ObjectId& object_id, | 113 const invalidation::ObjectId& object_id, |
| 114 bool is_transient, | 114 bool is_transient, |
| 115 const std::string& error_message) OVERRIDE; | 115 const std::string& error_message) override; |
| 116 virtual void ReissueRegistrations( | 116 virtual void ReissueRegistrations( |
| 117 invalidation::InvalidationClient* client, | 117 invalidation::InvalidationClient* client, |
| 118 const std::string& prefix, | 118 const std::string& prefix, |
| 119 int prefix_length) OVERRIDE; | 119 int prefix_length) override; |
| 120 virtual void InformError( | 120 virtual void InformError( |
| 121 invalidation::InvalidationClient* client, | 121 invalidation::InvalidationClient* client, |
| 122 const invalidation::ErrorInfo& error_info) OVERRIDE; | 122 const invalidation::ErrorInfo& error_info) override; |
| 123 | 123 |
| 124 // AckHandler implementation. | 124 // AckHandler implementation. |
| 125 virtual void Acknowledge( | 125 virtual void Acknowledge( |
| 126 const invalidation::ObjectId& id, | 126 const invalidation::ObjectId& id, |
| 127 const syncer::AckHandle& handle) OVERRIDE; | 127 const syncer::AckHandle& handle) override; |
| 128 virtual void Drop( | 128 virtual void Drop( |
| 129 const invalidation::ObjectId& id, | 129 const invalidation::ObjectId& id, |
| 130 const syncer::AckHandle& handle) OVERRIDE; | 130 const syncer::AckHandle& handle) override; |
| 131 | 131 |
| 132 // StateWriter implementation. | 132 // StateWriter implementation. |
| 133 virtual void WriteState(const std::string& state) OVERRIDE; | 133 virtual void WriteState(const std::string& state) override; |
| 134 | 134 |
| 135 // SyncNetworkChannel::Observer implementation. | 135 // SyncNetworkChannel::Observer implementation. |
| 136 virtual void OnNetworkChannelStateChanged( | 136 virtual void OnNetworkChannelStateChanged( |
| 137 InvalidatorState invalidator_state) OVERRIDE; | 137 InvalidatorState invalidator_state) override; |
| 138 | 138 |
| 139 void DoRegistrationUpdate(); | 139 void DoRegistrationUpdate(); |
| 140 | 140 |
| 141 void RequestDetailedStatus( | 141 void RequestDetailedStatus( |
| 142 base::Callback<void(const base::DictionaryValue&)> callback) const; | 142 base::Callback<void(const base::DictionaryValue&)> callback) const; |
| 143 | 143 |
| 144 void StopForTest(); | 144 void StopForTest(); |
| 145 | 145 |
| 146 private: | 146 private: |
| 147 void Stop(); | 147 void Stop(); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 InvalidatorState push_client_state_; | 191 InvalidatorState push_client_state_; |
| 192 | 192 |
| 193 base::WeakPtrFactory<SyncInvalidationListener> weak_ptr_factory_; | 193 base::WeakPtrFactory<SyncInvalidationListener> weak_ptr_factory_; |
| 194 | 194 |
| 195 DISALLOW_COPY_AND_ASSIGN(SyncInvalidationListener); | 195 DISALLOW_COPY_AND_ASSIGN(SyncInvalidationListener); |
| 196 }; | 196 }; |
| 197 | 197 |
| 198 } // namespace syncer | 198 } // namespace syncer |
| 199 | 199 |
| 200 #endif // COMPONENTS_INVALIDATION_SYNC_INVALIDATION_LISTENER_H_ | 200 #endif // COMPONENTS_INVALIDATION_SYNC_INVALIDATION_LISTENER_H_ |
| OLD | NEW |