| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/notifier/base/proxy_resolving_client_socket.h" | 5 #include "jingle/notifier/base/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/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 proxy_info_.UseDirect(); | 158 proxy_info_.UseDirect(); |
| 159 } else { | 159 } else { |
| 160 CloseTransportSocket(); | 160 CloseTransportSocket(); |
| 161 RunUserConnectCallback(status); | 161 RunUserConnectCallback(status); |
| 162 return; | 162 return; |
| 163 } | 163 } |
| 164 } | 164 } |
| 165 | 165 |
| 166 transport_.reset(new net::ClientSocketHandle); | 166 transport_.reset(new net::ClientSocketHandle); |
| 167 // Now that we have resolved the proxy, we need to connect. | 167 // Now that we have resolved the proxy, we need to connect. |
| 168 status = net::ClientSocketPoolManager::InitSocketHandleForRawConnect( | 168 status = net::InitSocketHandleForRawConnect( |
| 169 dest_host_port_pair_, | 169 dest_host_port_pair_, |
| 170 network_session_.get(), | 170 network_session_.get(), |
| 171 proxy_info_, | 171 proxy_info_, |
| 172 ssl_config_, | 172 ssl_config_, |
| 173 ssl_config_, | 173 ssl_config_, |
| 174 bound_net_log_, | 174 bound_net_log_, |
| 175 transport_.get(), | 175 transport_.get(), |
| 176 &connect_callback_); | 176 &connect_callback_); |
| 177 if (status != net::ERR_IO_PENDING) { | 177 if (status != net::ERR_IO_PENDING) { |
| 178 // Since this method is always called asynchronously. it is OK to call | 178 // Since this method is always called asynchronously. it is OK to call |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 return base::TimeDelta::FromMicroseconds(-1); | 367 return base::TimeDelta::FromMicroseconds(-1); |
| 368 } | 368 } |
| 369 | 369 |
| 370 void ProxyResolvingClientSocket::CloseTransportSocket() { | 370 void ProxyResolvingClientSocket::CloseTransportSocket() { |
| 371 if (transport_.get() && transport_->socket()) | 371 if (transport_.get() && transport_->socket()) |
| 372 transport_->socket()->Disconnect(); | 372 transport_->socket()->Disconnect(); |
| 373 transport_.reset(); | 373 transport_.reset(); |
| 374 } | 374 } |
| 375 | 375 |
| 376 } // namespace notifier | 376 } // namespace notifier |
| OLD | NEW |