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_stream_factory_impl_job.h" | 5 #include "net/http/http_stream_factory_impl_job.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
851 // paused. | 851 // paused. |
852 if (waiting_job_) { | 852 if (waiting_job_) { |
853 waiting_job_->Resume(this); | 853 waiting_job_->Resume(this); |
854 waiting_job_ = NULL; | 854 waiting_job_ = NULL; |
855 } | 855 } |
856 | 856 |
857 if (proxy_info_.is_http() || proxy_info_.is_https()) | 857 if (proxy_info_.is_http() || proxy_info_.is_https()) |
858 establishing_tunnel_ = using_ssl_; | 858 establishing_tunnel_ = using_ssl_; |
859 | 859 |
860 // TODO(bnc): s/want_spdy_over_npn/expect_spdy_over_npn/ | 860 // TODO(bnc): s/want_spdy_over_npn/expect_spdy_over_npn/ |
861 bool want_spdy_over_npn = IsAlternate(); | 861 bool want_spdy_over_npn = IsAlternate(); |
davidben
2015/05/01 23:21:46
(I'm guessing this is to be cleaned up in a follow
Bence
2015/05/04 12:05:07
Yes, that's the plan.
| |
862 | 862 |
863 if (proxy_info_.is_https()) { | 863 if (proxy_info_.is_https()) { |
864 InitSSLConfig(proxy_info_.proxy_server().host_port_pair(), | 864 InitSSLConfig(proxy_info_.proxy_server().host_port_pair(), |
865 &proxy_ssl_config_, | 865 &proxy_ssl_config_, |
866 true /* is a proxy server */); | 866 true /* is a proxy server */); |
867 // Disable revocation checking for HTTPS proxies since the revocation | 867 // Disable revocation checking for HTTPS proxies since the revocation |
868 // requests are probably going to need to go through the proxy too. | 868 // requests are probably going to need to go through the proxy too. |
869 proxy_ssl_config_.rev_checking_enabled = false; | 869 proxy_ssl_config_.rev_checking_enabled = false; |
870 } | 870 } |
871 if (using_ssl_) { | 871 if (using_ssl_) { |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1104 | 1104 |
1105 next_state_ = STATE_CREATE_STREAM_COMPLETE; | 1105 next_state_ = STATE_CREATE_STREAM_COMPLETE; |
1106 | 1106 |
1107 // We only set the socket motivation if we're the first to use | 1107 // We only set the socket motivation if we're the first to use |
1108 // this socket. Is there a race for two SPDY requests? We really | 1108 // this socket. Is there a race for two SPDY requests? We really |
1109 // need to plumb this through to the connect level. | 1109 // need to plumb this through to the connect level. |
1110 if (connection_->socket() && !connection_->is_reused()) | 1110 if (connection_->socket() && !connection_->is_reused()) |
1111 SetSocketMotivation(); | 1111 SetSocketMotivation(); |
1112 | 1112 |
1113 if (!using_spdy_) { | 1113 if (!using_spdy_) { |
1114 if (IsAlternate()) { | |
1115 return ERR_NPN_NEGOTIATION_FAILED; | |
1116 } | |
davidben
2015/05/01 23:21:46
Nit: While I do like curly braces, Chromium style
Bence
2015/05/04 12:05:07
Done.
| |
1114 // We may get ftp scheme when fetching ftp resources through proxy. | 1117 // We may get ftp scheme when fetching ftp resources through proxy. |
1115 bool using_proxy = (proxy_info_.is_http() || proxy_info_.is_https()) && | 1118 bool using_proxy = (proxy_info_.is_http() || proxy_info_.is_https()) && |
1116 (request_info_.url.SchemeIs("http") || | 1119 (request_info_.url.SchemeIs("http") || |
1117 request_info_.url.SchemeIs("ftp")); | 1120 request_info_.url.SchemeIs("ftp")); |
1118 if (stream_factory_->for_websockets_) { | 1121 if (stream_factory_->for_websockets_) { |
1119 DCHECK(request_); | 1122 DCHECK(request_); |
1120 DCHECK(request_->websocket_handshake_stream_create_helper()); | 1123 DCHECK(request_->websocket_handshake_stream_create_helper()); |
1121 websocket_stream_.reset( | 1124 websocket_stream_.reset( |
1122 request_->websocket_handshake_stream_create_helper() | 1125 request_->websocket_handshake_stream_create_helper() |
1123 ->CreateBasicStream(connection_.Pass(), using_proxy)); | 1126 ->CreateBasicStream(connection_.Pass(), using_proxy)); |
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1550 | 1553 |
1551 void HttpStreamFactoryImpl::Job:: | 1554 void HttpStreamFactoryImpl::Job:: |
1552 MaybeCopyConnectionAttemptsFromClientSocketHandleToRequest() { | 1555 MaybeCopyConnectionAttemptsFromClientSocketHandleToRequest() { |
1553 if (IsOrphaned() || !connection_) | 1556 if (IsOrphaned() || !connection_) |
1554 return; | 1557 return; |
1555 | 1558 |
1556 request_->AddConnectionAttempts(connection_->connection_attempts()); | 1559 request_->AddConnectionAttempts(connection_->connection_attempts()); |
1557 } | 1560 } |
1558 | 1561 |
1559 } // namespace net | 1562 } // namespace net |
OLD | NEW |