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

Unified Diff: url/url_util.cc

Issue 2679383003: Share schemes needed for CSP between the browser and the renderer. (Closed)
Patch Set: 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
« url/url_util.h ('K') | « 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 d5c27d18760bbd0b8334b91b5de05cdc21976399..af9a987d29f378c01e0e14940a31713e97317e3f 100644
--- a/url/url_util.cc
+++ b/url/url_util.cc
@@ -86,6 +86,7 @@ std::vector<std::string>* secure_schemes = nullptr;
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>* bypassing_csp_schemes = nullptr;
// See the LockSchemeRegistries declaration in the header.
bool scheme_registries_locked = false;
@@ -512,6 +513,7 @@ void Initialize() {
arraysize(kNoAccessSchemes));
InitSchemes(&cors_enabled_schemes, kCORSEnabledSchemes,
arraysize(kCORSEnabledSchemes));
+ InitSchemes(&bypassing_csp_schemes, nullptr, 0);
initialized = true;
}
@@ -529,6 +531,8 @@ void Shutdown() {
no_access_schemes = nullptr;
delete cors_enabled_schemes;
cors_enabled_schemes = nullptr;
+ delete bypassing_csp_schemes;
+ bypassing_csp_schemes = nullptr;
}
void AddStandardScheme(const char* new_scheme, SchemeType type) {
@@ -581,6 +585,16 @@ const std::vector<std::string>& GetCORSEnabledSchemes() {
return *cors_enabled_schemes;
}
+void AddBypassingCSPScheme(const char* new_scheme) {
+ Initialize();
+ DoAddScheme(new_scheme, bypassing_csp_schemes);
+}
+
+const std::vector<std::string>& GetBypassingCSPSchemes() {
+ Initialize();
+ return *bypassing_csp_schemes;
+}
+
void LockSchemeRegistries() {
scheme_registries_locked = true;
}
« url/url_util.h ('K') | « url/url_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698