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

Unified Diff: third_party/WebKit/Source/platform/weborigin/SchemeRegistry.cpp

Issue 2760463005: Fix handling of external protocols with PlzNavigate. (Closed)
Patch Set: review comments Created 3 years, 9 months 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/weborigin/SchemeRegistry.cpp
diff --git a/third_party/WebKit/Source/platform/weborigin/SchemeRegistry.cpp b/third_party/WebKit/Source/platform/weborigin/SchemeRegistry.cpp
index a49e0ddbed53969c56fc5916a1b93dd6c470ed96..f80b72108f4221913f50cb3cfac05a2b98eb9b46 100644
--- a/third_party/WebKit/Source/platform/weborigin/SchemeRegistry.cpp
+++ b/third_party/WebKit/Source/platform/weborigin/SchemeRegistry.cpp
@@ -39,10 +39,9 @@ namespace {
class URLSchemesRegistry final {
public:
URLSchemesRegistry()
- : emptyDocumentSchemes({"about"}),
- // For ServiceWorker schemes: HTTP is required because http://localhost
- // is considered secure. Additional checks are performed to ensure that
- // other http pages are filtered out.
+ : // For ServiceWorker schemes: HTTP is required because http://localhost
+ // is considered secure. Additional checks are performed to ensure that
+ // other http pages are filtered out.
serviceWorkerSchemes({"http", "https"}),
fetchAPISchemes({"http", "https"}),
allowedInReferrerSchemes({"http", "https"}) {
@@ -58,6 +57,8 @@ class URLSchemesRegistry final {
contentSecurityPolicyBypassingSchemes.insert(
scheme.c_str(), SchemeRegistry::PolicyAreaAll);
}
+ for (auto& scheme : url::GetEmptyDocumentSchemes())
+ emptyDocumentSchemes.insert(scheme.c_str());
}
~URLSchemesRegistry() = default;
@@ -161,11 +162,6 @@ bool SchemeRegistry::shouldTreatURLSchemeAsSecure(const String& scheme) {
return getURLSchemesRegistry().secureSchemes.contains(scheme);
}
-void SchemeRegistry::registerURLSchemeAsEmptyDocument(const String& scheme) {
- DCHECK_EQ(scheme, scheme.lower());
- getMutableURLSchemesRegistry().emptyDocumentSchemes.insert(scheme);
-}
-
bool SchemeRegistry::shouldLoadURLSchemeAsEmptyDocument(const String& scheme) {
DCHECK_EQ(scheme, scheme.lower());
if (scheme.isEmpty())

Powered by Google App Engine
This is Rietveld 408576698