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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
697 | 697 |
698 if (using_quic_) { | 698 if (using_quic_) { |
699 DCHECK(session_->params().enable_quic); | 699 DCHECK(session_->params().enable_quic); |
700 if (!proxy_info_.is_direct()) { | 700 if (!proxy_info_.is_direct()) { |
701 NOTREACHED(); | 701 NOTREACHED(); |
702 // TODO(rch): support QUIC proxies. | 702 // TODO(rch): support QUIC proxies. |
703 return ERR_NOT_IMPLEMENTED; | 703 return ERR_NOT_IMPLEMENTED; |
704 } | 704 } |
705 next_state_ = STATE_INIT_CONNECTION_COMPLETE; | 705 next_state_ = STATE_INIT_CONNECTION_COMPLETE; |
706 const ProxyServer& proxy_server = proxy_info_.proxy_server(); | 706 const ProxyServer& proxy_server = proxy_info_.proxy_server(); |
707 return quic_request_.Request(HostPortProxyPair(origin_, proxy_server), | 707 int rv = quic_request_.Request(HostPortProxyPair(origin_, proxy_server), |
708 net_log_, io_callback_); | 708 net_log_, io_callback_); |
| 709 if (rv != OK) { |
| 710 // OK, there's no available QUIC session. Let |waiting_job_| resume |
| 711 // if it's paused. |
| 712 if (waiting_job_) { |
| 713 waiting_job_->Resume(this); |
| 714 waiting_job_ = NULL; |
| 715 } |
| 716 } |
| 717 return rv; |
709 } | 718 } |
710 | 719 |
711 // Check first if we have a spdy session for this group. If so, then go | 720 // Check first if we have a spdy session for this group. If so, then go |
712 // straight to using that. | 721 // straight to using that. |
713 SpdySessionKey spdy_session_key = GetSpdySessionKey(); | 722 SpdySessionKey spdy_session_key = GetSpdySessionKey(); |
714 scoped_refptr<SpdySession> spdy_session = | 723 scoped_refptr<SpdySession> spdy_session = |
715 session_->spdy_session_pool()->GetIfExists(spdy_session_key, net_log_); | 724 session_->spdy_session_pool()->GetIfExists(spdy_session_key, net_log_); |
716 if (spdy_session.get() && CanUseExistingSpdySession()) { | 725 if (spdy_session.get() && CanUseExistingSpdySession()) { |
717 // If we're preconnecting, but we already have a SpdySession, we don't | 726 // If we're preconnecting, but we already have a SpdySession, we don't |
718 // actually need to preconnect any sockets, so we're done. | 727 // actually need to preconnect any sockets, so we're done. |
(...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1375 (net::LOAD_MAIN_FRAME | net::LOAD_SUB_FRAME | net::LOAD_PREFETCH | | 1384 (net::LOAD_MAIN_FRAME | net::LOAD_SUB_FRAME | net::LOAD_PREFETCH | |
1376 net::LOAD_IS_DOWNLOAD)) { | 1385 net::LOAD_IS_DOWNLOAD)) { |
1377 // Avoid pipelining resources that may be streamed for a long time. | 1386 // Avoid pipelining resources that may be streamed for a long time. |
1378 return false; | 1387 return false; |
1379 } | 1388 } |
1380 return stream_factory_->http_pipelined_host_pool_.IsKeyEligibleForPipelining( | 1389 return stream_factory_->http_pipelined_host_pool_.IsKeyEligibleForPipelining( |
1381 *http_pipelining_key_.get()); | 1390 *http_pipelining_key_.get()); |
1382 } | 1391 } |
1383 | 1392 |
1384 } // namespace net | 1393 } // namespace net |
OLD | NEW |