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

Unified Diff: url/url_util.cc

Issue 2679383003: Share schemes needed for CSP between the browser and the renderer. (Closed)
Patch Set: Rebase and fix conflict. Created 3 years, 10 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 5daab04f3495d0eb3cbafb7dcc5793b1a667e2cf..83cf71f3de14d48581f5972a70cfb1d87ebdc936 100644
--- a/url/url_util.cc
+++ b/url/url_util.cc
@@ -96,6 +96,7 @@ std::vector<std::string>* local_schemes = nullptr;
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;
// See the LockSchemeRegistries declaration in the header.
bool scheme_registries_locked = false;
@@ -524,6 +525,7 @@ void Initialize() {
arraysize(kCORSEnabledSchemes));
InitSchemes(&web_storage_schemes, kWebStorageSchemes,
arraysize(kWebStorageSchemes));
+ InitSchemes(&csp_bypassing_schemes, nullptr, 0);
initialized = true;
}
@@ -543,6 +545,8 @@ void Shutdown() {
cors_enabled_schemes = nullptr;
delete web_storage_schemes;
web_storage_schemes = nullptr;
+ delete csp_bypassing_schemes;
+ csp_bypassing_schemes = nullptr;
}
void AddStandardScheme(const char* new_scheme, SchemeType type) {
@@ -605,6 +609,16 @@ const std::vector<std::string>& GetWebStorageSchemes() {
return *web_storage_schemes;
}
+void AddCSPBypassingScheme(const char* new_scheme) {
+ Initialize();
+ DoAddScheme(new_scheme, csp_bypassing_schemes);
+}
+
+const std::vector<std::string>& GetCSPBypassingSchemes() {
+ Initialize();
+ return *csp_bypassing_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