OLD | NEW |
---|---|
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 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_controller.h" | 5 #include "net/http/http_stream_factory_impl_job_controller.h" |
6 | 6 |
7 #include "base/metrics/histogram_macros.h" | 7 #include "base/metrics/histogram_macros.h" |
8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "net/base/host_mapping_rules.h" | 10 #include "net/base/host_mapping_rules.h" |
(...skipping 732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
743 // These systems also enforce ports <1024 as restricted ports. So don't | 743 // These systems also enforce ports <1024 as restricted ports. So don't |
744 // allow protocol upgrades to user-controllable ports. | 744 // allow protocol upgrades to user-controllable ports. |
745 const int kUnrestrictedPort = 1024; | 745 const int kUnrestrictedPort = 1024; |
746 if (!session_->params().enable_user_alternate_protocol_ports && | 746 if (!session_->params().enable_user_alternate_protocol_ports && |
747 (alternative_service.port >= kUnrestrictedPort && | 747 (alternative_service.port >= kUnrestrictedPort && |
748 origin.port() < kUnrestrictedPort)) | 748 origin.port() < kUnrestrictedPort)) |
749 continue; | 749 continue; |
750 | 750 |
751 if (alternative_service.protocol >= NPN_SPDY_MINIMUM_VERSION && | 751 if (alternative_service.protocol >= NPN_SPDY_MINIMUM_VERSION && |
752 alternative_service.protocol <= NPN_SPDY_MAXIMUM_VERSION) { | 752 alternative_service.protocol <= NPN_SPDY_MAXIMUM_VERSION) { |
753 if (!HttpStreamFactory::spdy_enabled()) | |
mef
2016/07/13 18:26:32
It seems that this flag is used to control both sp
Bence
2016/07/15 20:35:33
Ugh, good catch. This was definitely not my inten
| |
754 continue; | |
755 | |
756 if (origin.host() != alternative_service.host && | 753 if (origin.host() != alternative_service.host && |
757 !session_->params() | 754 !session_->params() |
758 .enable_http2_alternative_service_with_different_host) { | 755 .enable_http2_alternative_service_with_different_host) { |
759 continue; | 756 continue; |
760 } | 757 } |
761 | 758 |
762 // Cache this entry if we don't have a non-broken Alt-Svc yet. | 759 // Cache this entry if we don't have a non-broken Alt-Svc yet. |
763 if (first_alternative_service.protocol == | 760 if (first_alternative_service.protocol == |
764 UNINITIALIZED_ALTERNATE_PROTOCOL) | 761 UNINITIALIZED_ALTERNATE_PROTOCOL) |
765 first_alternative_service = alternative_service; | 762 first_alternative_service = alternative_service; |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
810 first_alternative_service = alternative_service; | 807 first_alternative_service = alternative_service; |
811 } | 808 } |
812 | 809 |
813 // Ask delegate to mark QUIC as broken for the origin. | 810 // Ask delegate to mark QUIC as broken for the origin. |
814 if (quic_advertised && quic_all_broken && delegate != nullptr) | 811 if (quic_advertised && quic_all_broken && delegate != nullptr) |
815 delegate->OnQuicBroken(); | 812 delegate->OnQuicBroken(); |
816 | 813 |
817 return first_alternative_service; | 814 return first_alternative_service; |
818 } | 815 } |
819 } | 816 } |
OLD | NEW |