| 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 #include "components/invalidation/impl/sync_system_resources.h" | 5 #include "components/invalidation/impl/sync_system_resources.h" |
| 6 | 6 |
| 7 #include <cstdlib> | 7 #include <cstdlib> |
| 8 #include <cstring> | 8 #include <cstring> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 // Notify NetworkStatusReceivers in cacheinvalidation. | 186 // Notify NetworkStatusReceivers in cacheinvalidation. |
| 187 for (NetworkStatusReceiverList::const_iterator it = | 187 for (NetworkStatusReceiverList::const_iterator it = |
| 188 network_status_receivers_.begin(); | 188 network_status_receivers_.begin(); |
| 189 it != network_status_receivers_.end(); ++it) { | 189 it != network_status_receivers_.end(); ++it) { |
| 190 (*it)->Run(online); | 190 (*it)->Run(online); |
| 191 } | 191 } |
| 192 } | 192 } |
| 193 | 193 |
| 194 void SyncNetworkChannel::NotifyChannelStateChange( | 194 void SyncNetworkChannel::NotifyChannelStateChange( |
| 195 InvalidatorState invalidator_state) { | 195 InvalidatorState invalidator_state) { |
| 196 FOR_EACH_OBSERVER(Observer, observers_, | 196 for (auto& observer : observers_) |
| 197 OnNetworkChannelStateChanged(invalidator_state)); | 197 observer.OnNetworkChannelStateChanged(invalidator_state); |
| 198 } | 198 } |
| 199 | 199 |
| 200 bool SyncNetworkChannel::DeliverIncomingMessage(const std::string& message) { | 200 bool SyncNetworkChannel::DeliverIncomingMessage(const std::string& message) { |
| 201 if (!incoming_receiver_) { | 201 if (!incoming_receiver_) { |
| 202 DLOG(ERROR) << "No receiver for incoming notification"; | 202 DLOG(ERROR) << "No receiver for incoming notification"; |
| 203 return false; | 203 return false; |
| 204 } | 204 } |
| 205 received_messages_count_++; | 205 received_messages_count_++; |
| 206 incoming_receiver_->Run(message); | 206 incoming_receiver_->Run(message); |
| 207 return true; | 207 return true; |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 | 329 |
| 330 SyncInvalidationScheduler* SyncSystemResources::internal_scheduler() { | 330 SyncInvalidationScheduler* SyncSystemResources::internal_scheduler() { |
| 331 return internal_scheduler_.get(); | 331 return internal_scheduler_.get(); |
| 332 } | 332 } |
| 333 | 333 |
| 334 SyncInvalidationScheduler* SyncSystemResources::listener_scheduler() { | 334 SyncInvalidationScheduler* SyncSystemResources::listener_scheduler() { |
| 335 return listener_scheduler_.get(); | 335 return listener_scheduler_.get(); |
| 336 } | 336 } |
| 337 | 337 |
| 338 } // namespace syncer | 338 } // namespace syncer |
| OLD | NEW |