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

Unified Diff: third_party/WebKit/Source/wtf/text/TextEncodingRegistry.cpp

Issue 2731643002: Fuzzer for TextCodecs (Closed)
Patch Set: fuzzer overload Created 3 years, 10 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/wtf/text/TextEncodingRegistry.cpp
diff --git a/third_party/WebKit/Source/wtf/text/TextEncodingRegistry.cpp b/third_party/WebKit/Source/wtf/text/TextEncodingRegistry.cpp
index a8a0aa5d3cbd22db3f226b0e94556251aa2c796c..337202ce48d818ca2d7c978685836a6880124e99 100644
--- a/third_party/WebKit/Source/wtf/text/TextEncodingRegistry.cpp
+++ b/third_party/WebKit/Source/wtf/text/TextEncodingRegistry.cpp
@@ -313,4 +313,20 @@ void dumpTextEncodingNameMap() {
}
#endif
+Vector<String> getEncodingNamesForTesting() {
+ if (!textEncodingNameMap)
+ buildBaseTextCodecMaps();
+ MutexLocker lock(encodingRegistryMutex());
+ if (!atomicDidExtendTextCodecMaps()) {
+ extendTextCodecMaps();
+ atomicSetDidExtendTextCodecMaps();
+ }
+ Vector<String> encodings;
+ for (const auto& it : *textCodecMap) {
+ if (strcmp(it.key, "replacement"))
+ encodings.push_back(it.key);
+ }
+ return encodings;
+}
+
} // namespace WTF

Powered by Google App Engine
This is Rietveld 408576698