OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_request.h" | 5 #include "net/http/http_stream_request.h" |
6 | 6 |
7 #include "base/stl_util-inl.h" | 7 #include "base/stl_util-inl.h" |
8 #include "base/string_number_conversions.h" | 8 #include "base/string_number_conversions.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/stringprintf.h" | 10 #include "base/stringprintf.h" |
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
485 using_ssl_ = request_info().url.SchemeIs("https") || | 485 using_ssl_ = request_info().url.SchemeIs("https") || |
486 ShouldForceSpdySSL() || want_spdy_over_npn; | 486 ShouldForceSpdySSL() || want_spdy_over_npn; |
487 using_spdy_ = false; | 487 using_spdy_ = false; |
488 | 488 |
489 // If spdy has been turned off on-the-fly, then there may be SpdySessions | 489 // If spdy has been turned off on-the-fly, then there may be SpdySessions |
490 // still active. But don't use them unless spdy is currently on. | 490 // still active. But don't use them unless spdy is currently on. |
491 if (HttpStreamFactory::spdy_enabled()) { | 491 if (HttpStreamFactory::spdy_enabled()) { |
492 // Check first if we have a spdy session for this group. If so, then go | 492 // Check first if we have a spdy session for this group. If so, then go |
493 // straight to using that. | 493 // straight to using that. |
494 HostPortProxyPair pair(endpoint_, proxy_info()->proxy_server()); | 494 HostPortProxyPair pair(endpoint_, proxy_info()->proxy_server()); |
495 if (!preconnect_delegate_ && | 495 if (session_->spdy_session_pool()->HasSession(pair)) { |
496 session_->spdy_session_pool()->HasSession(pair)) { | 496 // If we're preconnecting, we're do need to preconnect anything since we |
| 497 // already have a SpdySession, so we're done. |
| 498 if (preconnect_delegate_) |
| 499 return OK; |
497 using_spdy_ = true; | 500 using_spdy_ = true; |
498 next_state_ = STATE_CREATE_STREAM; | 501 next_state_ = STATE_CREATE_STREAM; |
499 return OK; | 502 return OK; |
500 } | 503 } |
501 // Check next if we have a spdy session for this proxy. If so, then go | 504 // Check next if we have a spdy session for this proxy. If so, then go |
502 // straight to using that. | 505 // straight to using that. |
503 if (IsHttpsProxyAndHttpUrl()) { | 506 if (IsHttpsProxyAndHttpUrl()) { |
504 HostPortProxyPair proxy(proxy_info()->proxy_server().host_port_pair(), | 507 HostPortProxyPair proxy(proxy_info()->proxy_server().host_port_pair(), |
505 ProxyServer::Direct()); | 508 ProxyServer::Direct()); |
506 if (session_->spdy_session_pool()->HasSession(proxy)) { | 509 if (session_->spdy_session_pool()->HasSession(proxy)) { |
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1093 base::TimeDelta::FromMinutes(6), | 1096 base::TimeDelta::FromMinutes(6), |
1094 100); | 1097 100); |
1095 break; | 1098 break; |
1096 default: | 1099 default: |
1097 NOTREACHED(); | 1100 NOTREACHED(); |
1098 break; | 1101 break; |
1099 } | 1102 } |
1100 } | 1103 } |
1101 | 1104 |
1102 } // namespace net | 1105 } // namespace net |
OLD | NEW |