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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 | 130 |
131 int ProxyResolvingClientSocket::Connect( | 131 int ProxyResolvingClientSocket::Connect( |
132 const net::CompletionCallback& callback) { | 132 const net::CompletionCallback& callback) { |
133 DCHECK(user_connect_callback_.is_null()); | 133 DCHECK(user_connect_callback_.is_null()); |
134 | 134 |
135 tried_direct_connect_fallback_ = false; | 135 tried_direct_connect_fallback_ = false; |
136 | 136 |
137 // First we try and resolve the proxy. | 137 // First we try and resolve the proxy. |
138 int status = network_session_->proxy_service()->ResolveProxy( | 138 int status = network_session_->proxy_service()->ResolveProxy( |
139 proxy_url_, | 139 proxy_url_, |
| 140 0, |
140 &proxy_info_, | 141 &proxy_info_, |
141 proxy_resolve_callback_, | 142 proxy_resolve_callback_, |
142 &pac_request_, | 143 &pac_request_, |
143 bound_net_log_); | 144 bound_net_log_); |
144 if (status != net::ERR_IO_PENDING) { | 145 if (status != net::ERR_IO_PENDING) { |
145 // We defer execution of ProcessProxyResolveDone instead of calling it | 146 // We defer execution of ProcessProxyResolveDone instead of calling it |
146 // directly here for simplicity. From the caller's point of view, | 147 // directly here for simplicity. From the caller's point of view, |
147 // the connect always happens asynchronously. | 148 // the connect always happens asynchronously. |
148 base::MessageLoop* message_loop = base::MessageLoop::current(); | 149 base::MessageLoop* message_loop = base::MessageLoop::current(); |
149 CHECK(message_loop); | 150 CHECK(message_loop); |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 return false; | 397 return false; |
397 } | 398 } |
398 | 399 |
399 void ProxyResolvingClientSocket::CloseTransportSocket() { | 400 void ProxyResolvingClientSocket::CloseTransportSocket() { |
400 if (transport_.get() && transport_->socket()) | 401 if (transport_.get() && transport_->socket()) |
401 transport_->socket()->Disconnect(); | 402 transport_->socket()->Disconnect(); |
402 transport_.reset(); | 403 transport_.reset(); |
403 } | 404 } |
404 | 405 |
405 } // namespace jingle_glue | 406 } // namespace jingle_glue |
OLD | NEW |