OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_wrapper.h" | 5 #include "net/http/http_proxy_client_socket_wrapper.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
525 // It's possible that a session to the proxy has recently been created | 525 // It's possible that a session to the proxy has recently been created |
526 if (spdy_session) { | 526 if (spdy_session) { |
527 if (transport_socket_handle_.get()) { | 527 if (transport_socket_handle_.get()) { |
528 if (transport_socket_handle_->socket()) | 528 if (transport_socket_handle_->socket()) |
529 transport_socket_handle_->socket()->Disconnect(); | 529 transport_socket_handle_->socket()->Disconnect(); |
530 transport_socket_handle_->Reset(); | 530 transport_socket_handle_->Reset(); |
531 } | 531 } |
532 } else { | 532 } else { |
533 // Create a session direct to the proxy itself | 533 // Create a session direct to the proxy itself |
534 spdy_session = spdy_session_pool_->CreateAvailableSessionFromSocket( | 534 spdy_session = spdy_session_pool_->CreateAvailableSessionFromSocket( |
535 key, std::move(transport_socket_handle_), net_log_, OK, | 535 key, std::move(transport_socket_handle_), net_log_, |
536 /*using_ssl_*/ true); | 536 /*using_ssl_*/ true); |
537 DCHECK(spdy_session); | 537 DCHECK(spdy_session); |
538 } | 538 } |
539 | 539 |
540 next_state_ = STATE_SPDY_PROXY_CREATE_STREAM_COMPLETE; | 540 next_state_ = STATE_SPDY_PROXY_CREATE_STREAM_COMPLETE; |
541 return spdy_stream_request_.StartRequest( | 541 return spdy_stream_request_.StartRequest( |
542 SPDY_BIDIRECTIONAL_STREAM, spdy_session, | 542 SPDY_BIDIRECTIONAL_STREAM, spdy_session, |
543 GURL("https://" + endpoint_.ToString()), priority_, | 543 GURL("https://" + endpoint_.ToString()), priority_, |
544 spdy_session->net_log(), | 544 spdy_session->net_log(), |
545 base::Bind(&HttpProxyClientSocketWrapper::OnIOComplete, | 545 base::Bind(&HttpProxyClientSocketWrapper::OnIOComplete, |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
623 const HostResolver::RequestInfo& | 623 const HostResolver::RequestInfo& |
624 HttpProxyClientSocketWrapper::GetDestination() { | 624 HttpProxyClientSocketWrapper::GetDestination() { |
625 if (transport_params_) { | 625 if (transport_params_) { |
626 return transport_params_->destination(); | 626 return transport_params_->destination(); |
627 } else { | 627 } else { |
628 return ssl_params_->GetDirectConnectionParams()->destination(); | 628 return ssl_params_->GetDirectConnectionParams()->destination(); |
629 } | 629 } |
630 } | 630 } |
631 | 631 |
632 } // namespace net | 632 } // namespace net |
OLD | NEW |