| 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 830 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 841 priority_, | 841 priority_, |
| 842 session_, | 842 session_, |
| 843 proxy_info_, | 843 proxy_info_, |
| 844 ShouldForceSpdySSL(), | 844 ShouldForceSpdySSL(), |
| 845 want_spdy_over_npn, | 845 want_spdy_over_npn, |
| 846 server_ssl_config_, | 846 server_ssl_config_, |
| 847 proxy_ssl_config_, | 847 proxy_ssl_config_, |
| 848 request_info_.privacy_mode, | 848 request_info_.privacy_mode, |
| 849 net_log_, | 849 net_log_, |
| 850 num_streams_); | 850 num_streams_); |
| 851 } else { | 851 } |
| 852 // If we can't use a SPDY session, don't both checking for one after | 852 |
| 853 // the hostname is resolved. | 853 // If we can't use a SPDY session, don't both checking for one after |
| 854 OnHostResolutionCallback resolution_callback = CanUseExistingSpdySession() ? | 854 // the hostname is resolved. |
| 855 base::Bind(&Job::OnHostResolution, session_->spdy_session_pool(), | 855 OnHostResolutionCallback resolution_callback = CanUseExistingSpdySession() ? |
| 856 GetSpdySessionKey()) : | 856 base::Bind(&Job::OnHostResolution, session_->spdy_session_pool(), |
| 857 OnHostResolutionCallback(); | 857 GetSpdySessionKey()) : |
| 858 if (stream_factory_->for_websockets_) { | 858 OnHostResolutionCallback(); |
| 859 // TODO(ricea): Re-enable NPN when WebSockets over SPDY is supported. | 859 if (stream_factory_->for_websockets_) { |
| 860 SSLConfig websocket_server_ssl_config = server_ssl_config_; | 860 // TODO(ricea): Re-enable NPN when WebSockets over SPDY is supported. |
| 861 websocket_server_ssl_config.next_protos.clear(); | 861 SSLConfig websocket_server_ssl_config = server_ssl_config_; |
| 862 return InitSocketHandleForWebSocketRequest( | 862 websocket_server_ssl_config.next_protos.clear(); |
| 863 origin_url_, request_info_.extra_headers, request_info_.load_flags, | 863 return InitSocketHandleForWebSocketRequest( |
| 864 priority_, session_, proxy_info_, ShouldForceSpdySSL(), | |
| 865 want_spdy_over_npn, websocket_server_ssl_config, proxy_ssl_config_, | |
| 866 request_info_.privacy_mode, net_log_, | |
| 867 connection_.get(), resolution_callback, io_callback_); | |
| 868 } | |
| 869 return InitSocketHandleForHttpRequest( | |
| 870 origin_url_, request_info_.extra_headers, request_info_.load_flags, | 864 origin_url_, request_info_.extra_headers, request_info_.load_flags, |
| 871 priority_, session_, proxy_info_, ShouldForceSpdySSL(), | 865 priority_, session_, proxy_info_, ShouldForceSpdySSL(), |
| 872 want_spdy_over_npn, server_ssl_config_, proxy_ssl_config_, | 866 want_spdy_over_npn, websocket_server_ssl_config, proxy_ssl_config_, |
| 873 request_info_.privacy_mode, net_log_, | 867 request_info_.privacy_mode, net_log_, |
| 874 connection_.get(), resolution_callback, io_callback_); | 868 connection_.get(), resolution_callback, io_callback_); |
| 875 } | 869 } |
| 870 |
| 871 return InitSocketHandleForHttpRequest( |
| 872 origin_url_, request_info_.extra_headers, request_info_.load_flags, |
| 873 priority_, session_, proxy_info_, ShouldForceSpdySSL(), |
| 874 want_spdy_over_npn, server_ssl_config_, proxy_ssl_config_, |
| 875 request_info_.privacy_mode, net_log_, |
| 876 connection_.get(), resolution_callback, io_callback_); |
| 876 } | 877 } |
| 877 | 878 |
| 878 int HttpStreamFactoryImpl::Job::DoInitConnectionComplete(int result) { | 879 int HttpStreamFactoryImpl::Job::DoInitConnectionComplete(int result) { |
| 879 if (IsPreconnecting()) { | 880 if (IsPreconnecting()) { |
| 880 if (using_quic_) | 881 if (using_quic_) |
| 881 return result; | 882 return result; |
| 882 DCHECK_EQ(OK, result); | 883 DCHECK_EQ(OK, result); |
| 883 return OK; | 884 return OK; |
| 884 } | 885 } |
| 885 | 886 |
| (...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1492 (net::LOAD_MAIN_FRAME | net::LOAD_SUB_FRAME | net::LOAD_PREFETCH | | 1493 (net::LOAD_MAIN_FRAME | net::LOAD_SUB_FRAME | net::LOAD_PREFETCH | |
| 1493 net::LOAD_IS_DOWNLOAD)) { | 1494 net::LOAD_IS_DOWNLOAD)) { |
| 1494 // Avoid pipelining resources that may be streamed for a long time. | 1495 // Avoid pipelining resources that may be streamed for a long time. |
| 1495 return false; | 1496 return false; |
| 1496 } | 1497 } |
| 1497 return stream_factory_->http_pipelined_host_pool_.IsKeyEligibleForPipelining( | 1498 return stream_factory_->http_pipelined_host_pool_.IsKeyEligibleForPipelining( |
| 1498 *http_pipelining_key_.get()); | 1499 *http_pipelining_key_.get()); |
| 1499 } | 1500 } |
| 1500 | 1501 |
| 1501 } // namespace net | 1502 } // namespace net |
| OLD | NEW |