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 "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/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 spdy_pool->FindAvailableSession(key, net_log()); | 308 spdy_pool->FindAvailableSession(key, net_log()); |
309 // It's possible that a session to the proxy has recently been created | 309 // It's possible that a session to the proxy has recently been created |
310 if (spdy_session) { | 310 if (spdy_session) { |
311 if (transport_socket_handle_.get()) { | 311 if (transport_socket_handle_.get()) { |
312 if (transport_socket_handle_->socket()) | 312 if (transport_socket_handle_->socket()) |
313 transport_socket_handle_->socket()->Disconnect(); | 313 transport_socket_handle_->socket()->Disconnect(); |
314 transport_socket_handle_->Reset(); | 314 transport_socket_handle_->Reset(); |
315 } | 315 } |
316 } else { | 316 } else { |
317 // Create a session direct to the proxy itself | 317 // Create a session direct to the proxy itself |
318 spdy_session = | 318 int rv = spdy_pool->CreateAvailableSessionFromSocket( |
319 spdy_pool->CreateAvailableSessionFromSocket( | 319 key, transport_socket_handle_.Pass(), |
320 key, transport_socket_handle_.Pass(), | 320 net_log(), OK, &spdy_session, /*using_ssl_*/ true); |
321 net_log(), OK, /*using_ssl_*/ true); | 321 if (rv < 0) |
322 DCHECK(spdy_session); | 322 return rv; |
323 } | 323 } |
324 | 324 |
325 next_state_ = STATE_SPDY_PROXY_CREATE_STREAM_COMPLETE; | 325 next_state_ = STATE_SPDY_PROXY_CREATE_STREAM_COMPLETE; |
326 return spdy_stream_request_.StartRequest(SPDY_BIDIRECTIONAL_STREAM, | 326 return spdy_stream_request_.StartRequest(SPDY_BIDIRECTIONAL_STREAM, |
327 spdy_session, | 327 spdy_session, |
328 params_->request_url(), | 328 params_->request_url(), |
329 priority(), | 329 priority(), |
330 spdy_session->net_log(), | 330 spdy_session->net_log(), |
331 callback_); | 331 callback_); |
332 } | 332 } |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
534 base_.RemoveHigherLayeredPool(higher_pool); | 534 base_.RemoveHigherLayeredPool(higher_pool); |
535 } | 535 } |
536 | 536 |
537 bool HttpProxyClientSocketPool::CloseOneIdleConnection() { | 537 bool HttpProxyClientSocketPool::CloseOneIdleConnection() { |
538 if (base_.CloseOneIdleSocket()) | 538 if (base_.CloseOneIdleSocket()) |
539 return true; | 539 return true; |
540 return base_.CloseOneIdleConnectionInHigherLayeredPool(); | 540 return base_.CloseOneIdleConnectionInHigherLayeredPool(); |
541 } | 541 } |
542 | 542 |
543 } // namespace net | 543 } // namespace net |
OLD | NEW |