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

Unified Diff: url/url_util.cc

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
« no previous file with comments | « url/url_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: url/url_util.cc
diff --git a/url/url_util.cc b/url/url_util.cc
index a79e114fed36ae6fdd9822ebdb9a0c49a948ee26..a17ec4d86d4c1269af1858fe695bfc064310a4b4 100644
--- a/url/url_util.cc
+++ b/url/url_util.cc
@@ -81,6 +81,10 @@ const char* kWebStorageSchemes[] = {
kWssScheme,
};
+const char* kEmptyDocumentSchemes[] = {
+ kAboutScheme,
brettw 2017/03/23 22:02:13 Indenting.
jam 2017/03/23 22:36:04 I'll do this in a followup if you don't mind, just
+};
+
bool initialized = false;
// Lists of the currently installed standard and referrer schemes. These lists
@@ -96,6 +100,7 @@ std::vector<std::string>* no_access_schemes = nullptr;
std::vector<std::string>* cors_enabled_schemes = nullptr;
std::vector<std::string>* web_storage_schemes = nullptr;
std::vector<std::string>* csp_bypassing_schemes = nullptr;
+std::vector<std::string>* empty_document_schemes = nullptr;
// See the LockSchemeRegistries declaration in the header.
bool scheme_registries_locked = false;
@@ -525,6 +530,8 @@ void Initialize() {
InitSchemes(&web_storage_schemes, kWebStorageSchemes,
arraysize(kWebStorageSchemes));
InitSchemes(&csp_bypassing_schemes, nullptr, 0);
+ InitSchemes(&empty_document_schemes, kEmptyDocumentSchemes,
+ arraysize(kEmptyDocumentSchemes));
initialized = true;
}
@@ -546,6 +553,8 @@ void Shutdown() {
web_storage_schemes = nullptr;
delete csp_bypassing_schemes;
csp_bypassing_schemes = nullptr;
+ delete empty_document_schemes;
+ empty_document_schemes = nullptr;
}
void AddStandardScheme(const char* new_scheme, SchemeType type) {
@@ -618,6 +627,16 @@ const std::vector<std::string>& GetCSPBypassingSchemes() {
return *csp_bypassing_schemes;
}
+void AddEmptyDocumentScheme(const char* new_scheme) {
+ Initialize();
+ DoAddScheme(new_scheme, empty_document_schemes);
+}
+
+const std::vector<std::string>& GetEmptyDocumentSchemes() {
+ Initialize();
+ return *empty_document_schemes;
+}
+
void LockSchemeRegistries() {
scheme_registries_locked = true;
}
« no previous file with comments | « url/url_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698