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

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

Issue 2546233002: Fuzzer for TextCodecs (Closed)
Patch Set: Moved to platform/ Created 4 years 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 78394e484806d4b0e997fd370ae5b5a4e6034eda..69e25e99ce1828888ff4095d4b3e31e8387eba03 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.append(it.key);
+ }
+ return encodings;
+}
+
} // namespace WTF

Powered by Google App Engine
This is Rietveld 408576698