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

Unified Diff: third_party/WebKit/Source/core/fetch/CrossOriginAccessControl.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
Index: third_party/WebKit/Source/core/fetch/CrossOriginAccessControl.cpp
diff --git a/third_party/WebKit/Source/core/fetch/CrossOriginAccessControl.cpp b/third_party/WebKit/Source/core/fetch/CrossOriginAccessControl.cpp
index dcb529296169cb0aac624519db4d5bcd08dbd2a4..77f5867bb4ae7d7a6c439f0a60173162f53ddc14 100644
--- a/third_party/WebKit/Source/core/fetch/CrossOriginAccessControl.cpp
+++ b/third_party/WebKit/Source/core/fetch/CrossOriginAccessControl.cpp
@@ -43,24 +43,16 @@
namespace blink {
-static std::unique_ptr<HTTPHeaderSet> createAllowedCrossOriginResponseHeadersSet()
-{
- std::unique_ptr<HTTPHeaderSet> headerSet = wrapUnique(new HashSet<String, CaseFoldingHash>);
-
- headerSet->add("cache-control");
- headerSet->add("content-language");
- headerSet->add("content-type");
- headerSet->add("expires");
- headerSet->add("last-modified");
- headerSet->add("pragma");
-
- return headerSet;
-}
-
bool isOnAccessControlResponseHeaderWhitelist(const String& name)
{
- DEFINE_THREAD_SAFE_STATIC_LOCAL(HTTPHeaderSet, allowedCrossOriginResponseHeaders, (createAllowedCrossOriginResponseHeadersSet().release()));
-
+ DEFINE_THREAD_SAFE_STATIC_LOCAL(HTTPHeaderSet, allowedCrossOriginResponseHeaders, (new HTTPHeaderSet({
+ "cache-control",
+ "content-language",
+ "content-type",
+ "expires",
+ "last-modified",
+ "pragma",
+ })));
return allowedCrossOriginResponseHeaders.contains(name);
}

Powered by Google App Engine
This is Rietveld 408576698