Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2011 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2007-2009 Torch Mobile, Inc. | 3 * Copyright (C) 2007-2009 Torch Mobile, Inc. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 31 #include "wtf/CurrentTime.h" | 31 #include "wtf/CurrentTime.h" |
| 32 #include "wtf/HashMap.h" | 32 #include "wtf/HashMap.h" |
| 33 #include "wtf/HashSet.h" | 33 #include "wtf/HashSet.h" |
| 34 #include "wtf/MainThread.h" | 34 #include "wtf/MainThread.h" |
| 35 #include "wtf/StdLibExtras.h" | 35 #include "wtf/StdLibExtras.h" |
| 36 #include "wtf/StringExtras.h" | 36 #include "wtf/StringExtras.h" |
| 37 #include "wtf/ThreadingPrimitives.h" | 37 #include "wtf/ThreadingPrimitives.h" |
| 38 #include "wtf/text/CString.h" | 38 #include "wtf/text/CString.h" |
| 39 #include "wtf/text/TextCodecICU.h" | 39 #include "wtf/text/TextCodecICU.h" |
| 40 #include "wtf/text/TextCodecLatin1.h" | 40 #include "wtf/text/TextCodecLatin1.h" |
| 41 #include "wtf/text/TextCodecReplacement.h" | |
| 41 #include "wtf/text/TextCodecUTF16.h" | 42 #include "wtf/text/TextCodecUTF16.h" |
| 42 #include "wtf/text/TextCodecUTF8.h" | 43 #include "wtf/text/TextCodecUTF8.h" |
| 43 #include "wtf/text/TextCodecUserDefined.h" | 44 #include "wtf/text/TextCodecUserDefined.h" |
| 44 #include "wtf/text/TextEncoding.h" | 45 #include "wtf/text/TextEncoding.h" |
| 45 | 46 |
| 46 namespace WTF { | 47 namespace WTF { |
| 47 | 48 |
| 48 const size_t maxEncodingNameLength = 63; | 49 const size_t maxEncodingNameLength = 63; |
| 49 | 50 |
| 50 // Hash for all-ASCII strings that does case folding. | 51 // Hash for all-ASCII strings that does case folding. |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 213 TextCodecLatin1::registerCodecs(addToTextCodecMap); | 214 TextCodecLatin1::registerCodecs(addToTextCodecMap); |
| 214 | 215 |
| 215 TextCodecUTF8::registerEncodingNames(addToTextEncodingNameMap); | 216 TextCodecUTF8::registerEncodingNames(addToTextEncodingNameMap); |
| 216 TextCodecUTF8::registerCodecs(addToTextCodecMap); | 217 TextCodecUTF8::registerCodecs(addToTextCodecMap); |
| 217 | 218 |
| 218 TextCodecUTF16::registerEncodingNames(addToTextEncodingNameMap); | 219 TextCodecUTF16::registerEncodingNames(addToTextEncodingNameMap); |
| 219 TextCodecUTF16::registerCodecs(addToTextCodecMap); | 220 TextCodecUTF16::registerCodecs(addToTextCodecMap); |
| 220 | 221 |
| 221 TextCodecUserDefined::registerEncodingNames(addToTextEncodingNameMap); | 222 TextCodecUserDefined::registerEncodingNames(addToTextEncodingNameMap); |
| 222 TextCodecUserDefined::registerCodecs(addToTextCodecMap); | 223 TextCodecUserDefined::registerCodecs(addToTextCodecMap); |
| 224 | |
| 225 TextCodecReplacement::registerEncodingNames(addToTextEncodingNameMap); | |
| 226 TextCodecReplacement::registerCodecs(addToTextCodecMap); | |
| 227 textEncodingNameMap->remove("replacement"); | |
|
jsbell
2014/02/21 22:35:55
This seems like a hack, but so far as I can tell t
| |
| 223 } | 228 } |
| 224 | 229 |
| 225 static void addEncodingName(HashSet<const char*>* set, const char* name) | 230 static void addEncodingName(HashSet<const char*>* set, const char* name) |
| 226 { | 231 { |
| 227 // We must not use atomicCanonicalTextEncodingName() because this function i s called in it. | 232 // We must not use atomicCanonicalTextEncodingName() because this function i s called in it. |
| 228 const char* atomicName = textEncodingNameMap->get(name); | 233 const char* atomicName = textEncodingNameMap->get(name); |
| 229 if (atomicName) | 234 if (atomicName) |
| 230 set->add(atomicName); | 235 set->add(atomicName); |
| 231 } | 236 } |
| 232 | 237 |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 353 MutexLocker lock(encodingRegistryMutex()); | 358 MutexLocker lock(encodingRegistryMutex()); |
| 354 | 359 |
| 355 TextEncodingNameMap::const_iterator it = textEncodingNameMap->begin(); | 360 TextEncodingNameMap::const_iterator it = textEncodingNameMap->begin(); |
| 356 TextEncodingNameMap::const_iterator end = textEncodingNameMap->end(); | 361 TextEncodingNameMap::const_iterator end = textEncodingNameMap->end(); |
| 357 for (; it != end; ++it) | 362 for (; it != end; ++it) |
| 358 fprintf(stderr, "'%s' => '%s'\n", it->key, it->value); | 363 fprintf(stderr, "'%s' => '%s'\n", it->key, it->value); |
| 359 } | 364 } |
| 360 #endif | 365 #endif |
| 361 | 366 |
| 362 } // namespace WTF | 367 } // namespace WTF |
| OLD | NEW |