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

Unified Diff: url/url_util.cc

Issue 2661543003: Introduce the concept of web schemes capable of storage (Closed)
Patch Set: Created 3 years, 11 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 9a2cce47aa116c047e8d49cc6235941be944075d..7c13056b78693269920f9ac792b28bbeb4437b20 100644
--- a/url/url_util.cc
+++ b/url/url_util.cc
@@ -73,6 +73,15 @@ const char* kCORSEnabledSchemes[] = {
kDataScheme,
};
+const char* kWebStorageSchemes[] = {
+ kHttpScheme,
+ kHttpsScheme,
+ kFileScheme,
+ kFtpScheme,
+ kWsScheme,
+ kWssScheme,
+};
+
bool initialized = false;
// Lists of the currently installed standard and referrer schemes. These lists
@@ -86,6 +95,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>* web_storage_schemes = nullptr;
// See the LockSchemeRegistries declaration in the header.
bool scheme_registries_locked = false;
@@ -514,6 +524,8 @@ void Initialize() {
arraysize(kNoAccessSchemes));
InitSchemes(&cors_enabled_schemes, kCORSEnabledSchemes,
arraysize(kCORSEnabledSchemes));
+ InitSchemes(&web_storage_schemes, kWebStorageSchemes,
+ arraysize(kWebStorageSchemes));
initialized = true;
}
@@ -531,6 +543,8 @@ void Shutdown() {
no_access_schemes = nullptr;
delete cors_enabled_schemes;
cors_enabled_schemes = nullptr;
+ delete web_storage_schemes;
+ web_storage_schemes = nullptr;
}
void AddStandardScheme(const char* new_scheme, SchemeType type) {
@@ -583,6 +597,16 @@ const std::vector<std::string>& GetCORSEnabledSchemes() {
return *cors_enabled_schemes;
}
+void AddWebStorageScheme(const char* new_scheme) {
+ Initialize();
+ DoAddScheme(new_scheme, web_storage_schemes);
+}
+
+const std::vector<std::string>& GetWebStorageSchemes() {
+ Initialize();
+ return *web_storage_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