| 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/StdLibExtras.h" | 34 #include "wtf/StdLibExtras.h" |
| 35 #include "wtf/StringExtras.h" | 35 #include "wtf/StringExtras.h" |
| 36 #include "wtf/ThreadingPrimitives.h" | 36 #include "wtf/ThreadingPrimitives.h" |
| 37 #include "wtf/text/CString.h" | 37 #include "wtf/text/CString.h" |
| 38 #include "wtf/text/TextCodecICU.h" | 38 #include "wtf/text/TextCodecICU.h" |
| 39 #include "wtf/text/TextCodecLatin1.h" | 39 #include "wtf/text/TextCodecLatin1.h" |
| 40 #include "wtf/text/TextCodecReplacement.h" | 40 #include "wtf/text/TextCodecReplacement.h" |
| 41 #include "wtf/text/TextCodecUTF16.h" | |
| 42 #include "wtf/text/TextCodecUTF8.h" | 41 #include "wtf/text/TextCodecUTF8.h" |
| 43 #include "wtf/text/TextCodecUserDefined.h" | 42 #include "wtf/text/TextCodecUserDefined.h" |
| 44 #include "wtf/text/TextEncoding.h" | 43 #include "wtf/text/TextEncoding.h" |
| 45 #include <memory> | 44 #include <memory> |
| 46 | 45 |
| 47 namespace WTF { | 46 namespace WTF { |
| 48 | 47 |
| 49 const size_t maxEncodingNameLength = 63; | 48 const size_t maxEncodingNameLength = 63; |
| 50 | 49 |
| 51 // Hash for all-ASCII strings that does case folding. | 50 // Hash for all-ASCII strings that does case folding. |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 | 208 |
| 210 textCodecMap = new TextCodecMap; | 209 textCodecMap = new TextCodecMap; |
| 211 textEncodingNameMap = new TextEncodingNameMap; | 210 textEncodingNameMap = new TextEncodingNameMap; |
| 212 | 211 |
| 213 TextCodecLatin1::registerEncodingNames(addToTextEncodingNameMap); | 212 TextCodecLatin1::registerEncodingNames(addToTextEncodingNameMap); |
| 214 TextCodecLatin1::registerCodecs(addToTextCodecMap); | 213 TextCodecLatin1::registerCodecs(addToTextCodecMap); |
| 215 | 214 |
| 216 TextCodecUTF8::registerEncodingNames(addToTextEncodingNameMap); | 215 TextCodecUTF8::registerEncodingNames(addToTextEncodingNameMap); |
| 217 TextCodecUTF8::registerCodecs(addToTextCodecMap); | 216 TextCodecUTF8::registerCodecs(addToTextCodecMap); |
| 218 | 217 |
| 219 TextCodecUTF16::registerEncodingNames(addToTextEncodingNameMap); | |
| 220 TextCodecUTF16::registerCodecs(addToTextCodecMap); | |
| 221 | |
| 222 TextCodecUserDefined::registerEncodingNames(addToTextEncodingNameMap); | 218 TextCodecUserDefined::registerEncodingNames(addToTextEncodingNameMap); |
| 223 TextCodecUserDefined::registerCodecs(addToTextCodecMap); | 219 TextCodecUserDefined::registerCodecs(addToTextCodecMap); |
| 224 } | 220 } |
| 225 | 221 |
| 226 bool isReplacementEncoding(const char* alias) | 222 bool isReplacementEncoding(const char* alias) |
| 227 { | 223 { |
| 228 return alias && !strcasecmp(alias, "replacement"); | 224 return alias && !strcasecmp(alias, "replacement"); |
| 229 } | 225 } |
| 230 | 226 |
| 231 bool isReplacementEncoding(const String& alias) | 227 bool isReplacementEncoding(const String& alias) |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 MutexLocker lock(encodingRegistryMutex()); | 312 MutexLocker lock(encodingRegistryMutex()); |
| 317 | 313 |
| 318 TextEncodingNameMap::const_iterator it = textEncodingNameMap->begin(); | 314 TextEncodingNameMap::const_iterator it = textEncodingNameMap->begin(); |
| 319 TextEncodingNameMap::const_iterator end = textEncodingNameMap->end(); | 315 TextEncodingNameMap::const_iterator end = textEncodingNameMap->end(); |
| 320 for (; it != end; ++it) | 316 for (; it != end; ++it) |
| 321 fprintf(stderr, "'%s' => '%s'\n", it->key, it->value); | 317 fprintf(stderr, "'%s' => '%s'\n", it->key, it->value); |
| 322 } | 318 } |
| 323 #endif | 319 #endif |
| 324 | 320 |
| 325 } // namespace WTF | 321 } // namespace WTF |
| OLD | NEW |