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 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
661 // Remove unsupported proxies from the list. | 661 // Remove unsupported proxies from the list. |
662 proxy_info_.RemoveProxiesWithoutScheme( | 662 proxy_info_.RemoveProxiesWithoutScheme( |
663 ProxyServer::SCHEME_DIRECT | ProxyServer::SCHEME_QUIC | | 663 ProxyServer::SCHEME_DIRECT | ProxyServer::SCHEME_QUIC | |
664 ProxyServer::SCHEME_HTTP | ProxyServer::SCHEME_HTTPS | | 664 ProxyServer::SCHEME_HTTP | ProxyServer::SCHEME_HTTPS | |
665 ProxyServer::SCHEME_SOCKS4 | ProxyServer::SCHEME_SOCKS5); | 665 ProxyServer::SCHEME_SOCKS4 | ProxyServer::SCHEME_SOCKS5); |
666 | 666 |
667 if (proxy_info_.is_empty()) { | 667 if (proxy_info_.is_empty()) { |
668 // No proxies/direct to choose from. This happens when we don't support | 668 // No proxies/direct to choose from. This happens when we don't support |
669 // any of the proxies in the returned list. | 669 // any of the proxies in the returned list. |
670 result = ERR_NO_SUPPORTED_PROXIES; | 670 result = ERR_NO_SUPPORTED_PROXIES; |
| 671 } else if (using_quic_ && |
| 672 (!proxy_info_.is_quic() && !proxy_info_.is_direct())) { |
| 673 // QUIC can not be spoken to non-QUIC proxies. This error should not be |
| 674 // user visible, because the non-alternate job should be resumed. |
| 675 result = ERR_NO_SUPPORTED_PROXIES; |
671 } | 676 } |
672 } | 677 } |
673 | 678 |
674 if (result != OK) { | 679 if (result != OK) { |
675 if (waiting_job_) { | 680 if (waiting_job_) { |
676 waiting_job_->Resume(this); | 681 waiting_job_->Resume(this); |
677 waiting_job_ = NULL; | 682 waiting_job_ = NULL; |
678 } | 683 } |
679 return result; | 684 return result; |
680 } | 685 } |
(...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1465 (net::LOAD_MAIN_FRAME | net::LOAD_SUB_FRAME | net::LOAD_PREFETCH | | 1470 (net::LOAD_MAIN_FRAME | net::LOAD_SUB_FRAME | net::LOAD_PREFETCH | |
1466 net::LOAD_IS_DOWNLOAD)) { | 1471 net::LOAD_IS_DOWNLOAD)) { |
1467 // Avoid pipelining resources that may be streamed for a long time. | 1472 // Avoid pipelining resources that may be streamed for a long time. |
1468 return false; | 1473 return false; |
1469 } | 1474 } |
1470 return stream_factory_->http_pipelined_host_pool_.IsKeyEligibleForPipelining( | 1475 return stream_factory_->http_pipelined_host_pool_.IsKeyEligibleForPipelining( |
1471 *http_pipelining_key_.get()); | 1476 *http_pipelining_key_.get()); |
1472 } | 1477 } |
1473 | 1478 |
1474 } // namespace net | 1479 } // namespace net |
OLD | NEW |