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

Unified Diff: third_party/WebKit/Source/core/dom/ScriptLoader.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 | « no previous file | third_party/WebKit/Source/core/dom/custom/CustomElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/ScriptLoader.cpp
diff --git a/third_party/WebKit/Source/core/dom/ScriptLoader.cpp b/third_party/WebKit/Source/core/dom/ScriptLoader.cpp
index a8337a8df390e92e0f5c4ad23955a52e56086473..deada626dfb2a885f2e50bf61674d1bae222c658 100644
--- a/third_party/WebKit/Source/core/dom/ScriptLoader.cpp
+++ b/third_party/WebKit/Source/core/dom/ScriptLoader.cpp
@@ -132,21 +132,20 @@ static bool isLegacySupportedJavaScriptLanguage(const String& language)
// FIXME: This function is not HTML5 compliant. These belong in the MIME registry as "text/javascript<version>" entries.
typedef HashSet<String, CaseFoldingHash> LanguageSet;
- DEFINE_STATIC_LOCAL(LanguageSet, languages, ());
- if (languages.isEmpty()) {
- languages.add("javascript");
- languages.add("javascript1.0");
- languages.add("javascript1.1");
- languages.add("javascript1.2");
- languages.add("javascript1.3");
- languages.add("javascript1.4");
- languages.add("javascript1.5");
- languages.add("javascript1.6");
- languages.add("javascript1.7");
- languages.add("livescript");
- languages.add("ecmascript");
- languages.add("jscript");
- }
+ DEFINE_STATIC_LOCAL(LanguageSet, languages, ({
+ "javascript",
+ "javascript1.0",
+ "javascript1.1",
+ "javascript1.2",
+ "javascript1.3",
+ "javascript1.4",
+ "javascript1.5",
+ "javascript1.6",
+ "javascript1.7",
+ "livescript",
+ "ecmascript",
+ "jscript",
+ }));
return languages.contains(language);
}
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/custom/CustomElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698