Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(137)

Side by Side Diff: net/http/http_stream_factory_impl_job.cc

Issue 2546533003: Respect QuicAllowed policy for new streams (Closed)
Patch Set: Naming, formatting Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 718 matching lines...) Expand 10 before | Expand all | Expand 10 after
729 int HttpStreamFactoryImpl::Job::DoResolveProxyComplete(int result) { 729 int HttpStreamFactoryImpl::Job::DoResolveProxyComplete(int result) {
730 pac_request_ = NULL; 730 pac_request_ = NULL;
731 731
732 if (result == OK) { 732 if (result == OK) {
733 // Remove unsupported proxies from the list. 733 // Remove unsupported proxies from the list.
734 int supported_proxies = 734 int supported_proxies =
735 ProxyServer::SCHEME_DIRECT | ProxyServer::SCHEME_HTTP | 735 ProxyServer::SCHEME_DIRECT | ProxyServer::SCHEME_HTTP |
736 ProxyServer::SCHEME_HTTPS | ProxyServer::SCHEME_SOCKS4 | 736 ProxyServer::SCHEME_HTTPS | ProxyServer::SCHEME_SOCKS4 |
737 ProxyServer::SCHEME_SOCKS5; 737 ProxyServer::SCHEME_SOCKS5;
738 738
739 if (session_->params().enable_quic) 739 if (session_->params().enable_quic_for_new_streams())
740 supported_proxies |= ProxyServer::SCHEME_QUIC; 740 supported_proxies |= ProxyServer::SCHEME_QUIC;
741 741
742 proxy_info_.RemoveProxiesWithoutScheme(supported_proxies); 742 proxy_info_.RemoveProxiesWithoutScheme(supported_proxies);
743 743
744 if (proxy_info_.is_empty()) { 744 if (proxy_info_.is_empty()) {
745 // No proxies/direct to choose from. This happens when we don't support 745 // No proxies/direct to choose from. This happens when we don't support
746 // any of the proxies in the returned list. 746 // any of the proxies in the returned list.
747 result = ERR_NO_SUPPORTED_PROXIES; 747 result = ERR_NO_SUPPORTED_PROXIES;
748 } else if (using_quic_ && 748 } else if (using_quic_ &&
749 (!proxy_info_.is_quic() && !proxy_info_.is_direct())) { 749 (!proxy_info_.is_quic() && !proxy_info_.is_direct())) {
(...skipping 14 matching lines...) Expand all
764 stream_type_); 764 stream_type_);
765 765
766 return OK; 766 return OK;
767 } 767 }
768 768
769 bool HttpStreamFactoryImpl::Job::ShouldForceQuic() const { 769 bool HttpStreamFactoryImpl::Job::ShouldForceQuic() const {
770 return session_->params().enable_quic && 770 return session_->params().enable_quic &&
771 (base::ContainsKey(session_->params().origins_to_force_quic_on, 771 (base::ContainsKey(session_->params().origins_to_force_quic_on,
772 HostPortPair()) || 772 HostPortPair()) ||
773 base::ContainsKey(session_->params().origins_to_force_quic_on, 773 base::ContainsKey(session_->params().origins_to_force_quic_on,
774 destination_)) && 774 destination_)) &&
mmenke 2016/12/13 18:48:54 So this overrides the new_streams setting, but not
pmarko 2016/12/19 21:25:11 Reduced to only enable_quic, the logic is now outs
775 proxy_info_.is_direct() && origin_url_.SchemeIs(url::kHttpsScheme); 775 proxy_info_.is_direct() && origin_url_.SchemeIs(url::kHttpsScheme);
776 } 776 }
777 777
778 int HttpStreamFactoryImpl::Job::DoWait() { 778 int HttpStreamFactoryImpl::Job::DoWait() {
779 next_state_ = STATE_WAIT_COMPLETE; 779 next_state_ = STATE_WAIT_COMPLETE;
780 if (delegate_->ShouldWait(this)) 780 if (delegate_->ShouldWait(this))
781 return ERR_IO_PENDING; 781 return ERR_IO_PENDING;
782 782
783 return OK; 783 return OK;
784 } 784 }
(...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after
1499 1499
1500 ConnectionAttempts socket_attempts = connection_->connection_attempts(); 1500 ConnectionAttempts socket_attempts = connection_->connection_attempts();
1501 if (connection_->socket()) { 1501 if (connection_->socket()) {
1502 connection_->socket()->GetConnectionAttempts(&socket_attempts); 1502 connection_->socket()->GetConnectionAttempts(&socket_attempts);
1503 } 1503 }
1504 1504
1505 delegate_->AddConnectionAttemptsToRequest(this, socket_attempts); 1505 delegate_->AddConnectionAttemptsToRequest(this, socket_attempts);
1506 } 1506 }
1507 1507
1508 } // namespace net 1508 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698