Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(102)

Side by Side Diff: net/http/http_proxy_client_socket_pool.cc

Issue 8898036: base::Bind: Convert proxy_resolving_client_socket.[cc,h] and deps. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Possible test fix. Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "net/http/http_proxy_client_socket_pool.h" 5 #include "net/http/http_proxy_client_socket_pool.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/time.h" 9 #include "base/time.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 } 167 }
168 } while (rv != ERR_IO_PENDING && next_state_ != STATE_NONE); 168 } while (rv != ERR_IO_PENDING && next_state_ != STATE_NONE);
169 169
170 return rv; 170 return rv;
171 } 171 }
172 172
173 int HttpProxyConnectJob::DoTransportConnect() { 173 int HttpProxyConnectJob::DoTransportConnect() {
174 next_state_ = STATE_TCP_CONNECT_COMPLETE; 174 next_state_ = STATE_TCP_CONNECT_COMPLETE;
175 transport_socket_handle_.reset(new ClientSocketHandle()); 175 transport_socket_handle_.reset(new ClientSocketHandle());
176 return transport_socket_handle_->Init( 176 return transport_socket_handle_->Init(
177 group_name(), 177 group_name(), params_->transport_params(),
178 params_->transport_params(), 178 params_->transport_params()->destination().priority(), callback_,
179 params_->transport_params()->destination().priority(), 179 transport_pool_, net_log());
180 &callback_old_,
181 transport_pool_,
182 net_log());
183 } 180 }
184 181
185 int HttpProxyConnectJob::DoTransportConnectComplete(int result) { 182 int HttpProxyConnectJob::DoTransportConnectComplete(int result) {
186 if (result != OK) 183 if (result != OK)
187 return ERR_PROXY_CONNECTION_FAILED; 184 return ERR_PROXY_CONNECTION_FAILED;
188 185
189 // Reset the timer to just the length of time allowed for HttpProxy handshake 186 // Reset the timer to just the length of time allowed for HttpProxy handshake
190 // so that a fast TCP connection plus a slow HttpProxy failure doesn't take 187 // so that a fast TCP connection plus a slow HttpProxy failure doesn't take
191 // longer to timeout than it should. 188 // longer to timeout than it should.
192 ResetTimer(base::TimeDelta::FromSeconds( 189 ResetTimer(base::TimeDelta::FromSeconds(
(...skipping 11 matching lines...) Expand all
204 using_spdy_ = true; 201 using_spdy_ = true;
205 next_state_ = STATE_SPDY_PROXY_CREATE_STREAM; 202 next_state_ = STATE_SPDY_PROXY_CREATE_STREAM;
206 return OK; 203 return OK;
207 } 204 }
208 } 205 }
209 next_state_ = STATE_SSL_CONNECT_COMPLETE; 206 next_state_ = STATE_SSL_CONNECT_COMPLETE;
210 transport_socket_handle_.reset(new ClientSocketHandle()); 207 transport_socket_handle_.reset(new ClientSocketHandle());
211 return transport_socket_handle_->Init( 208 return transport_socket_handle_->Init(
212 group_name(), params_->ssl_params(), 209 group_name(), params_->ssl_params(),
213 params_->ssl_params()->transport_params()->destination().priority(), 210 params_->ssl_params()->transport_params()->destination().priority(),
214 &callback_old_, ssl_pool_, net_log()); 211 callback_, ssl_pool_, net_log());
215 } 212 }
216 213
217 int HttpProxyConnectJob::DoSSLConnectComplete(int result) { 214 int HttpProxyConnectJob::DoSSLConnectComplete(int result) {
218 if (result == ERR_SSL_CLIENT_AUTH_CERT_NEEDED) { 215 if (result == ERR_SSL_CLIENT_AUTH_CERT_NEEDED) {
219 error_response_info_ = transport_socket_handle_->ssl_error_response_info(); 216 error_response_info_ = transport_socket_handle_->ssl_error_response_info();
220 DCHECK(error_response_info_.cert_request_info.get()); 217 DCHECK(error_response_info_.cert_request_info.get());
221 error_response_info_.cert_request_info->is_proxy = true; 218 error_response_info_.cert_request_info->is_proxy = true;
222 return result; 219 return result;
223 } 220 }
224 if (IsCertificateError(result)) { 221 if (IsCertificateError(result)) {
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
511 return base_.histograms(); 508 return base_.histograms();
512 } 509 }
513 510
514 bool HttpProxyClientSocketPool::CloseOneIdleConnection() { 511 bool HttpProxyClientSocketPool::CloseOneIdleConnection() {
515 if (base_.CloseOneIdleSocket()) 512 if (base_.CloseOneIdleSocket())
516 return true; 513 return true;
517 return base_.CloseOneIdleConnectionInLayeredPool(); 514 return base_.CloseOneIdleConnectionInLayeredPool();
518 } 515 }
519 516
520 } // namespace net 517 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_pipelined_connection_impl_unittest.cc ('k') | net/http/http_proxy_client_socket_pool_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698