Skip to content

Commit

Permalink
Remove quic-transport scheme
Browse files Browse the repository at this point in the history
`quic-transport` scheme was introduced for the QuicTransport API, but
it was replaced with the WebTransport API. The WebTransport API uses `https` scheme. Chromium doesn't use `quic-transport` scheme in any
place.

Note that this scheme does nothing for a proxy that uses QUIC as the
underlying transport layer. A proxy may use HTTP/3 but the scheme
should be `https` in that case.

Bug: 1416006
Change-Id: I595f42e2676dc712c1aab1426de3f7c51ad61c73
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4328307
Commit-Queue: Kenichi Ishibashi <bashi@chromium.org>
Reviewed-by: Adam Rice <ricea@chromium.org>
Reviewed-by: Hidehiko Abe <hidehiko@chromium.org>
Reviewed-by: Charlie Harrison <csharrison@chromium.org>
Reviewed-by: Varun Khaneja <vakh@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1116250}
  • Loading branch information
bashi authored and Chromium LUCI CQ committed Mar 13, 2023
1 parent 69ed27f commit 5c2514f
Show file tree
Hide file tree
Showing 14 changed files with 9 additions and 32 deletions.
Expand Up @@ -183,10 +183,6 @@ TEST(NetworkSettingsTranslationTest, CrosapiProxyToProxyConfigManual) {
location->port = 86;
location->scheme = crosapi::mojom::ProxyLocation::Scheme::kSocks5;
manual->http_proxies.push_back(location.Clone());
location->host = "proxy7";
location->port = 87;
location->scheme = crosapi::mojom::ProxyLocation::Scheme::kQuic;
manual->http_proxies.push_back(location.Clone());
location->host = "secure_proxy";
location->port = 81;
location->scheme = crosapi::mojom::ProxyLocation::Scheme::kHttps;
Expand All @@ -204,7 +200,6 @@ TEST(NetworkSettingsTranslationTest, CrosapiProxyToProxyConfigManual) {
GetManualProxyConfig("http=http://proxy1:80;http=https://proxy2:80;"
"http=http://proxy3:83;http=invalid://proxy4:84;"
"http=direct://proxy5:85;http=socks5://proxy6:86;"
"http=quic-transport://proxy7:87;"
"https=https://secure_proxy:81;"
"socks=socks://socks_proxy:82",
/*bypass_list=*/"localhost;google.com"));
Expand Down
Expand Up @@ -57,7 +57,7 @@ std::string FormatProxyUri(const char* request_scheme,
proxy_scheme_string = url::kHttpsScheme;
break;
case crosapi::mojom::ProxyLocation::Scheme::kQuic:
proxy_scheme_string = url::kQuicTransportScheme;
NOTREACHED();
break;
}

Expand Down
Expand Up @@ -28,7 +28,6 @@ const std::map<std::string, UrlScheme>& GetSchemeOptions() {
{url::kHttpsScheme, UrlScheme::kHttps},
{url::kJavaScriptScheme, UrlScheme::kJavascript},
{url::kMailToScheme, UrlScheme::kMailTo},
{url::kQuicTransportScheme, UrlScheme::kQuicTransport},
{url::kTelScheme, UrlScheme::kTel},
{url::kUrnScheme, UrlScheme::kUrn},
{url::kUuidInPackageScheme, UrlScheme::kUuidInPackage},
Expand Down
Expand Up @@ -27,7 +27,7 @@ enum class UrlScheme {
kHttps = 10,
kJavascript = 11,
kMailTo = 12,
kQuicTransport = 13,
kQuicTransport_Obsoleted = 13,
kTel = 14,
kUrn = 15,
kUuidInPackage = 16,
Expand Down
Expand Up @@ -27,7 +27,6 @@ TEST(SchemeLoggerTest, TestLogScheme) {
{"https://www.google.com/", UrlScheme::kHttps},
{"javascript:undefined", UrlScheme::kJavascript},
{"mailto:nobody", UrlScheme::kMailTo},
{"quic-transport://foo/", UrlScheme::kQuicTransport},
{"tel:123456789", UrlScheme::kTel},
{"urn:foo", UrlScheme::kUrn},
{"uuid-in-package:foo", UrlScheme::kUuidInPackage},
Expand Down
1 change: 0 additions & 1 deletion net/base/url_util_unittest.cc
Expand Up @@ -739,7 +739,6 @@ TEST(UrlUtilTest, SchemeHasNetworkHost) {
EXPECT_TRUE(IsStandardSchemeWithNetworkHost(url::kHttpsScheme));
EXPECT_TRUE(IsStandardSchemeWithNetworkHost(url::kWsScheme));
EXPECT_TRUE(IsStandardSchemeWithNetworkHost(url::kWssScheme));
EXPECT_TRUE(IsStandardSchemeWithNetworkHost(url::kQuicTransportScheme));
EXPECT_TRUE(IsStandardSchemeWithNetworkHost(url::kFtpScheme));
EXPECT_TRUE(IsStandardSchemeWithNetworkHost(url::kFileScheme));
EXPECT_TRUE(IsStandardSchemeWithNetworkHost(
Expand Down
2 changes: 0 additions & 2 deletions net/cookies/cookie_constants.cc
Expand Up @@ -332,8 +332,6 @@ CookieSourceSchemeName GetSchemeNameEnum(const GURL& url) {
return CookieSourceSchemeName::kJavaScriptScheme;
} else if (url.SchemeIs(url::kMailToScheme)) {
return CookieSourceSchemeName::kMailToScheme;
} else if (url.SchemeIs(url::kQuicTransportScheme)) {
return CookieSourceSchemeName::kQuicTransportScheme;
} else if (url.SchemeIs(url::kTelScheme)) {
return CookieSourceSchemeName::kTelScheme;
} else if (url.SchemeIs(url::kUrnScheme)) {
Expand Down
2 changes: 1 addition & 1 deletion net/cookies/cookie_constants.h
Expand Up @@ -297,7 +297,7 @@ enum class CookieSourceSchemeName {
kHttpsScheme = 14,
kJavaScriptScheme = 15,
kMailToScheme = 16,
kQuicTransportScheme = 17,
kQuicTransportScheme_Obsoleted = 17,
kTelScheme = 18,
kUrnScheme = 19,
kWsScheme = 20,
Expand Down
1 change: 0 additions & 1 deletion net/cookies/cookie_monster_unittest.cc
Expand Up @@ -5411,7 +5411,6 @@ TEST_F(CookieMonsterTest, CookieSourceSchemeNameHistogram) {
{CookieSourceSchemeName::kWsScheme, url::kWsScheme},
{CookieSourceSchemeName::kChromeExtensionScheme, "chrome-extension"},
{CookieSourceSchemeName::kFileScheme, url::kFileScheme},
{CookieSourceSchemeName::kQuicTransportScheme, url::kQuicTransportScheme},
{CookieSourceSchemeName::kOther, "abcd1234"}};

// Make sure all the schemes are considered cookieable.
Expand Down
Expand Up @@ -67,9 +67,6 @@ TYPED_TEST_P(AbstractTrustworthinessTest, OriginFromString) {
EXPECT_FALSE(
this->IsOriginPotentiallyTrustworthy("javascript:alert('blah')"));
EXPECT_FALSE(this->IsOriginPotentiallyTrustworthy("data:test/plain;blah"));

EXPECT_TRUE(this->IsOriginPotentiallyTrustworthy(
"quic-transport://example.com/counter"));
}

TYPED_TEST_P(AbstractTrustworthinessTest, CustomSchemes) {
Expand Down Expand Up @@ -208,9 +205,6 @@ TYPED_TEST_P(AbstractTrustworthinessTest, UrlFromString) {
"filesystem:blob:https://example.com/"
"578223a1-8c13-17b3-84d5-eca045ae384a"));

EXPECT_TRUE(this->IsUrlPotentiallyTrustworthy(
"quic-transport://example.com/counter"));

// These tests are imported from IsPotentiallyTrustworthy.Url.
EXPECT_TRUE(this->IsUrlPotentiallyTrustworthy("file:///test/fun.html"));
EXPECT_TRUE(this->IsUrlPotentiallyTrustworthy("file:///test/"));
Expand Down Expand Up @@ -318,7 +312,6 @@ TYPED_TEST_P(AbstractTrustworthinessTest, TestcasesInheritedFromBlink) {
// Secure transports are considered trustworthy.
{true, false, "https://foobar.com"},
{true, false, "wss://foobar.com"},
{true, false, "quic-transport://example.com/counter"},

// Insecure transports are not considered trustworthy.
{false, false, "ftp://foobar.com"},
Expand Down
4 changes: 0 additions & 4 deletions url/url_constants.cc
Expand Up @@ -40,10 +40,6 @@ const char kJavaScriptScheme[] = "javascript";
const char16_t kJavaScriptScheme16[] = u"javascript";
const char kMailToScheme[] = "mailto";
const char16_t kMailToScheme16[] = u"mailto";
// This is for QuicTransport (https://wicg.github.io/web-transport/).
// See also: https://www.iana.org/assignments/uri-schemes/prov/quic-transport
const char kQuicTransportScheme[] = "quic-transport";
const char16_t kQuicTransportScheme16[] = u"quic-transport";
const char kTelScheme[] = "tel";
const char16_t kTelScheme16[] = u"tel";
const char kUrnScheme[] = "urn";
Expand Down
2 changes: 0 additions & 2 deletions url/url_constants.h
Expand Up @@ -46,8 +46,6 @@ COMPONENT_EXPORT(URL) extern const char kJavaScriptScheme[];
COMPONENT_EXPORT(URL) extern const char16_t kJavaScriptScheme16[];
COMPONENT_EXPORT(URL) extern const char kMailToScheme[];
COMPONENT_EXPORT(URL) extern const char16_t kMailToScheme16[];
COMPONENT_EXPORT(URL) extern const char kQuicTransportScheme[];
COMPONENT_EXPORT(URL) extern const char16_t kQuicTransportScheme16[];
COMPONENT_EXPORT(URL) extern const char kTelScheme[];
COMPONENT_EXPORT(URL) extern const char16_t kTelScheme16[];
COMPONENT_EXPORT(URL) extern const char kUrnScheme[];
Expand Down
6 changes: 4 additions & 2 deletions url/url_util.cc
Expand Up @@ -57,7 +57,6 @@ struct SchemeRegistry {
SCHEME_WITH_HOST_PORT_AND_USER_INFORMATION}, // WebSocket secure.
{kWsScheme, SCHEME_WITH_HOST_PORT_AND_USER_INFORMATION}, // WebSocket.
{kFileSystemScheme, SCHEME_WITHOUT_AUTHORITY},
{kQuicTransportScheme, SCHEME_WITH_HOST_AND_PORT},
};

// Schemes that are allowed for referrers.
Expand All @@ -74,7 +73,10 @@ struct SchemeRegistry {

// Schemes that do not trigger mixed content warning.
std::vector<std::string> secure_schemes = {
kHttpsScheme, kAboutScheme, kDataScheme, kQuicTransportScheme, kWssScheme,
kHttpsScheme,
kWssScheme,
kDataScheme,
kAboutScheme,
};

// Schemes that normal pages cannot link to or access (i.e., with the same
Expand Down
5 changes: 2 additions & 3 deletions url/url_util_unittest.cc
Expand Up @@ -144,9 +144,8 @@ TEST_F(URLUtilTest, GetStandardSchemeType) {

TEST_F(URLUtilTest, GetStandardSchemes) {
std::vector<std::string> expected = {
kHttpsScheme, kHttpScheme, kFileScheme,
kFtpScheme, kWssScheme, kWsScheme,
kFileSystemScheme, kQuicTransportScheme, "foo",
kHttpsScheme, kHttpScheme, kFileScheme, kFtpScheme,
kWssScheme, kWsScheme, kFileSystemScheme, "foo",
};
AddStandardScheme("foo", url::SCHEME_WITHOUT_AUTHORITY);
EXPECT_EQ(expected, GetStandardSchemes());
Expand Down

0 comments on commit 5c2514f

Please sign in to comment.