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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 } | 163 } |
164 | 164 |
165 void SyncNetworkChannel::RemoveObserver(Observer* observer) { | 165 void SyncNetworkChannel::RemoveObserver(Observer* observer) { |
166 observers_.RemoveObserver(observer); | 166 observers_.RemoveObserver(observer); |
167 } | 167 } |
168 | 168 |
169 std::unique_ptr<SyncNetworkChannel> SyncNetworkChannel::CreatePushClientChannel( | 169 std::unique_ptr<SyncNetworkChannel> SyncNetworkChannel::CreatePushClientChannel( |
170 const notifier::NotifierOptions& notifier_options) { | 170 const notifier::NotifierOptions& notifier_options) { |
171 std::unique_ptr<notifier::PushClient> push_client( | 171 std::unique_ptr<notifier::PushClient> push_client( |
172 notifier::PushClient::CreateDefaultOnIOThread(notifier_options)); | 172 notifier::PushClient::CreateDefaultOnIOThread(notifier_options)); |
173 return base::WrapUnique(new PushClientChannel(std::move(push_client))); | 173 return base::MakeUnique<PushClientChannel>(std::move(push_client)); |
174 } | 174 } |
175 | 175 |
176 std::unique_ptr<SyncNetworkChannel> SyncNetworkChannel::CreateGCMNetworkChannel( | 176 std::unique_ptr<SyncNetworkChannel> SyncNetworkChannel::CreateGCMNetworkChannel( |
177 scoped_refptr<net::URLRequestContextGetter> request_context_getter, | 177 scoped_refptr<net::URLRequestContextGetter> request_context_getter, |
178 std::unique_ptr<GCMNetworkChannelDelegate> delegate) { | 178 std::unique_ptr<GCMNetworkChannelDelegate> delegate) { |
179 return base::WrapUnique( | 179 return base::MakeUnique<GCMNetworkChannel>(request_context_getter, |
180 new GCMNetworkChannel(request_context_getter, std::move(delegate))); | 180 std::move(delegate)); |
181 } | 181 } |
182 | 182 |
183 void SyncNetworkChannel::NotifyNetworkStatusChange(bool online) { | 183 void SyncNetworkChannel::NotifyNetworkStatusChange(bool online) { |
184 // Remember network state for future NetworkStatusReceivers. | 184 // Remember network state for future NetworkStatusReceivers. |
185 last_network_status_ = online; | 185 last_network_status_ = online; |
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); |
(...skipping 138 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 |