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

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

Issue 2142513003: Use initializer_lists for static WTF::HashSets. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 | « third_party/WebKit/Source/modules/webdatabase/DatabaseAuthorizer.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 be4f185c8067f6ee6bf9b37f2f3cec2eba4d28ac..e99659a272679a5d02b6302897c9af272636facc 100644
--- a/third_party/WebKit/Source/platform/weborigin/SchemeRegistry.cpp
+++ b/third_party/WebKit/Source/platform/weborigin/SchemeRegistry.cpp
@@ -65,50 +65,40 @@ static URLSchemesSet& displayIsolatedURLSchemes()
static URLSchemesSet& mixedContentRestrictingSchemes()
{
- DEFINE_STATIC_LOCAL_WITH_LOCK(URLSchemesSet, mixedContentRestrictingSchemes, ());
-
- if (mixedContentRestrictingSchemes.isEmpty())
- mixedContentRestrictingSchemes.add("https");
-
+ DEFINE_STATIC_LOCAL_WITH_LOCK(URLSchemesSet, mixedContentRestrictingSchemes, ({
+ "https",
+ }));
return mixedContentRestrictingSchemes;
}
static URLSchemesSet& secureSchemes()
{
- DEFINE_STATIC_LOCAL_WITH_LOCK(URLSchemesSet, secureSchemes, ());
-
- if (secureSchemes.isEmpty()) {
- secureSchemes.add("https");
- secureSchemes.add("about");
- secureSchemes.add("data");
- secureSchemes.add("wss");
- }
-
+ DEFINE_STATIC_LOCAL_WITH_LOCK(URLSchemesSet, secureSchemes, ({
+ "https",
+ "about",
+ "data",
+ "wss",
+ }));
return secureSchemes;
}
static URLSchemesSet& schemesWithUniqueOrigins()
{
- DEFINE_STATIC_LOCAL_WITH_LOCK(URLSchemesSet, schemesWithUniqueOrigins, ());
-
- if (schemesWithUniqueOrigins.isEmpty()) {
- schemesWithUniqueOrigins.add("about");
- schemesWithUniqueOrigins.add("javascript");
+ DEFINE_STATIC_LOCAL_WITH_LOCK(URLSchemesSet, schemesWithUniqueOrigins, ({
+ "about",
+ "javascript",
// This is a willful violation of HTML5.
// See https://bugs.webkit.org/show_bug.cgi?id=11885
- schemesWithUniqueOrigins.add("data");
- }
-
+ "data",
+ }));
return schemesWithUniqueOrigins;
}
static URLSchemesSet& emptyDocumentSchemes()
{
- DEFINE_STATIC_LOCAL_WITH_LOCK(URLSchemesSet, emptyDocumentSchemes, ());
-
- if (emptyDocumentSchemes.isEmpty())
- emptyDocumentSchemes.add("about");
-
+ DEFINE_STATIC_LOCAL_WITH_LOCK(URLSchemesSet, emptyDocumentSchemes, ({
+ "about",
+ }));
return emptyDocumentSchemes;
}
« no previous file with comments | « third_party/WebKit/Source/modules/webdatabase/DatabaseAuthorizer.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698