| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "google_apis/gcm/engine/connection_factory_impl.h" | 5 #include "google_apis/gcm/engine/connection_factory_impl.h" |
| 6 | 6 |
| 7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "base/metrics/sparse_histogram.h" | 9 #include "base/metrics/sparse_histogram.h" |
| 10 #include "google_apis/gcm/engine/connection_handler_impl.h" | 10 #include "google_apis/gcm/engine/connection_handler_impl.h" |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 DCHECK(!socket_handle_.socket()); | 273 DCHECK(!socket_handle_.socket()); |
| 274 | 274 |
| 275 if (waiting_for_network_online_) | 275 if (waiting_for_network_online_) |
| 276 return; | 276 return; |
| 277 | 277 |
| 278 connecting_ = true; | 278 connecting_ = true; |
| 279 GURL current_endpoint = GetCurrentEndpoint(); | 279 GURL current_endpoint = GetCurrentEndpoint(); |
| 280 recorder_->RecordConnectionInitiated(current_endpoint.host()); | 280 recorder_->RecordConnectionInitiated(current_endpoint.host()); |
| 281 int status = network_session_->proxy_service()->ResolveProxy( | 281 int status = network_session_->proxy_service()->ResolveProxy( |
| 282 current_endpoint, | 282 current_endpoint, |
| 283 0, |
| 283 &proxy_info_, | 284 &proxy_info_, |
| 284 base::Bind(&ConnectionFactoryImpl::OnProxyResolveDone, | 285 base::Bind(&ConnectionFactoryImpl::OnProxyResolveDone, |
| 285 weak_ptr_factory_.GetWeakPtr()), | 286 weak_ptr_factory_.GetWeakPtr()), |
| 286 &pac_request_, | 287 &pac_request_, |
| 287 bound_net_log_); | 288 bound_net_log_); |
| 288 if (status != net::ERR_IO_PENDING) | 289 if (status != net::ERR_IO_PENDING) |
| 289 OnProxyResolveDone(status); | 290 OnProxyResolveDone(status); |
| 290 } | 291 } |
| 291 | 292 |
| 292 void ConnectionFactoryImpl::InitHandler() { | 293 void ConnectionFactoryImpl::InitHandler() { |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 533 // the destroyed socket. | 534 // the destroyed socket. |
| 534 if (connection_handler_) | 535 if (connection_handler_) |
| 535 connection_handler_->Reset(); | 536 connection_handler_->Reset(); |
| 536 | 537 |
| 537 if (socket_handle_.socket() && socket_handle_.socket()->IsConnected()) | 538 if (socket_handle_.socket() && socket_handle_.socket()->IsConnected()) |
| 538 socket_handle_.socket()->Disconnect(); | 539 socket_handle_.socket()->Disconnect(); |
| 539 socket_handle_.Reset(); | 540 socket_handle_.Reset(); |
| 540 } | 541 } |
| 541 | 542 |
| 542 } // namespace gcm | 543 } // namespace gcm |
| OLD | NEW |