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_network_transaction.h" | 5 #include "net/http/http_network_transaction.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 822 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
833 | 833 |
834 response_.network_accessed = true; | 834 response_.network_accessed = true; |
835 | 835 |
836 next_state_ = STATE_CREATE_STREAM_COMPLETE; | 836 next_state_ = STATE_CREATE_STREAM_COMPLETE; |
837 // IP based pooling is only enabled on a retry after 421 Misdirected Request | 837 // IP based pooling is only enabled on a retry after 421 Misdirected Request |
838 // is received. Alternative Services are also disabled in this case (though | 838 // is received. Alternative Services are also disabled in this case (though |
839 // they can also be disabled when retrying after a QUIC error). | 839 // they can also be disabled when retrying after a QUIC error). |
840 if (!enable_ip_based_pooling_) | 840 if (!enable_ip_based_pooling_) |
841 DCHECK(!enable_alternative_services_); | 841 DCHECK(!enable_alternative_services_); |
842 if (ForWebSocketHandshake()) { | 842 if (ForWebSocketHandshake()) { |
843 stream_request_.reset( | 843 stream_request_ = |
844 session_->http_stream_factory_for_websocket() | 844 session_->http_stream_factory_for_websocket() |
845 ->RequestWebSocketHandshakeStream( | 845 ->RequestWebSocketHandshakeStream( |
846 *request_, priority_, server_ssl_config_, proxy_ssl_config_, | 846 *request_, priority_, server_ssl_config_, proxy_ssl_config_, |
847 this, websocket_handshake_stream_base_create_helper_, | 847 this, websocket_handshake_stream_base_create_helper_, |
848 enable_ip_based_pooling_, enable_alternative_services_, | 848 enable_ip_based_pooling_, enable_alternative_services_, |
849 net_log_)); | 849 net_log_); |
850 } else { | 850 } else { |
851 stream_request_.reset(session_->http_stream_factory()->RequestStream( | 851 stream_request_ = session_->http_stream_factory()->RequestStream( |
852 *request_, priority_, server_ssl_config_, proxy_ssl_config_, this, | 852 *request_, priority_, server_ssl_config_, proxy_ssl_config_, this, |
853 enable_ip_based_pooling_, enable_alternative_services_, net_log_)); | 853 enable_ip_based_pooling_, enable_alternative_services_, net_log_); |
854 } | 854 } |
855 DCHECK(stream_request_.get()); | 855 DCHECK(stream_request_.get()); |
856 return ERR_IO_PENDING; | 856 return ERR_IO_PENDING; |
857 } | 857 } |
858 | 858 |
859 int HttpNetworkTransaction::DoCreateStreamComplete(int result) { | 859 int HttpNetworkTransaction::DoCreateStreamComplete(int result) { |
860 // If |result| is ERR_HTTPS_PROXY_TUNNEL_RESPONSE, then | 860 // If |result| is ERR_HTTPS_PROXY_TUNNEL_RESPONSE, then |
861 // DoCreateStreamComplete is being called from OnHttpsProxyTunnelResponse, | 861 // DoCreateStreamComplete is being called from OnHttpsProxyTunnelResponse, |
862 // which resets the stream request first. Therefore, we have to grab the | 862 // which resets the stream request first. Therefore, we have to grab the |
863 // connection attempts in *that* function instead of here in that case. | 863 // connection attempts in *that* function instead of here in that case. |
(...skipping 907 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1771 if (headers->IsRedirect(nullptr)) { | 1771 if (headers->IsRedirect(nullptr)) { |
1772 UMA_HISTOGRAM_BOOLEAN("Net.RedirectWithUnadvertisedContentEncoding", | 1772 UMA_HISTOGRAM_BOOLEAN("Net.RedirectWithUnadvertisedContentEncoding", |
1773 !result); | 1773 !result); |
1774 return true; | 1774 return true; |
1775 } | 1775 } |
1776 | 1776 |
1777 return result; | 1777 return result; |
1778 } | 1778 } |
1779 | 1779 |
1780 } // namespace net | 1780 } // namespace net |
OLD | NEW |