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

Unified Diff: third_party/WebKit/Source/core/fetch/RawResource.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/core/fetch/FetchUtils.cpp ('k') | third_party/WebKit/Source/core/html/RelList.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/fetch/RawResource.cpp
diff --git a/third_party/WebKit/Source/core/fetch/RawResource.cpp b/third_party/WebKit/Source/core/fetch/RawResource.cpp
index d6cfe5764744c359cf55a21268e55da4f1a3c563..94989229bc676da38c5fcdcde1c1c7308a27c492 100644
--- a/third_party/WebKit/Source/core/fetch/RawResource.cpp
+++ b/third_party/WebKit/Source/core/fetch/RawResource.cpp
@@ -205,19 +205,18 @@ void RawResource::setDefersLoading(bool defers)
static bool shouldIgnoreHeaderForCacheReuse(AtomicString headerName)
{
// FIXME: This list of headers that don't affect cache policy almost certainly isn't complete.
- DEFINE_STATIC_LOCAL(HashSet<AtomicString>, m_headers, ());
- if (m_headers.isEmpty()) {
- m_headers.add("Cache-Control");
- m_headers.add("If-Modified-Since");
- m_headers.add("If-None-Match");
- m_headers.add("Origin");
- m_headers.add("Pragma");
- m_headers.add("Purpose");
- m_headers.add("Referer");
- m_headers.add("User-Agent");
- m_headers.add(HTTPNames::X_DevTools_Emulate_Network_Conditions_Client_Id);
- }
- return m_headers.contains(headerName);
+ DEFINE_STATIC_LOCAL(HashSet<AtomicString>, headers, ({
+ "Cache-Control",
+ "If-Modified-Since",
+ "If-None-Match",
+ "Origin",
+ "Pragma",
+ "Purpose",
+ "Referer",
+ "User-Agent",
+ HTTPNames::X_DevTools_Emulate_Network_Conditions_Client_Id,
+ }));
+ return headers.contains(headerName);
}
static bool isCacheableHTTPMethod(const AtomicString& method)
« no previous file with comments | « third_party/WebKit/Source/core/fetch/FetchUtils.cpp ('k') | third_party/WebKit/Source/core/html/RelList.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698