| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "jingle/glue/proxy_resolving_client_socket.h" | 5 #include "jingle/glue/proxy_resolving_client_socket.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 CloseTransportSocket(); | 185 CloseTransportSocket(); |
| 186 RunUserConnectCallback(status); | 186 RunUserConnectCallback(status); |
| 187 return; | 187 return; |
| 188 } | 188 } |
| 189 } | 189 } |
| 190 | 190 |
| 191 transport_.reset(new net::ClientSocketHandle); | 191 transport_.reset(new net::ClientSocketHandle); |
| 192 // Now that we have resolved the proxy, we need to connect. | 192 // Now that we have resolved the proxy, we need to connect. |
| 193 status = net::InitSocketHandleForRawConnect( | 193 status = net::InitSocketHandleForRawConnect( |
| 194 dest_host_port_pair_, network_session_.get(), proxy_info_, ssl_config_, | 194 dest_host_port_pair_, network_session_.get(), proxy_info_, ssl_config_, |
| 195 ssl_config_, net::PRIVACY_MODE_DISABLED, bound_net_log_, transport_.get(), | 195 ssl_config_, net::kPrivacyModeDisabled, bound_net_log_, transport_.get(), |
| 196 connect_callback_); | 196 connect_callback_); |
| 197 if (status != net::ERR_IO_PENDING) { | 197 if (status != net::ERR_IO_PENDING) { |
| 198 // Since this method is always called asynchronously. it is OK to call | 198 // Since this method is always called asynchronously. it is OK to call |
| 199 // ProcessConnectDone synchronously. | 199 // ProcessConnectDone synchronously. |
| 200 ProcessConnectDone(status); | 200 ProcessConnectDone(status); |
| 201 } | 201 } |
| 202 } | 202 } |
| 203 | 203 |
| 204 void ProxyResolvingClientSocket::ProcessConnectDone(int status) { | 204 void ProxyResolvingClientSocket::ProcessConnectDone(int status) { |
| 205 if (status != net::OK) { | 205 if (status != net::OK) { |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 return false; | 389 return false; |
| 390 } | 390 } |
| 391 | 391 |
| 392 void ProxyResolvingClientSocket::CloseTransportSocket() { | 392 void ProxyResolvingClientSocket::CloseTransportSocket() { |
| 393 if (transport_.get() && transport_->socket()) | 393 if (transport_.get() && transport_->socket()) |
| 394 transport_->socket()->Disconnect(); | 394 transport_->socket()->Disconnect(); |
| 395 transport_.reset(); | 395 transport_.reset(); |
| 396 } | 396 } |
| 397 | 397 |
| 398 } // namespace jingle_glue | 398 } // namespace jingle_glue |
| OLD | NEW |