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

Side by Side Diff: Source/wtf/text/TextEncodingRegistry.cpp

Issue 999953003: Remove dedicated TextCodecUTF16 (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/wtf/text/TextEncoding.h ('k') | Source/wtf/wtf.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 21 matching lines...) Expand all
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/TextCodecReplacement.h"
42 #include "wtf/text/TextCodecUTF16.h"
43 #include "wtf/text/TextCodecUTF8.h" 42 #include "wtf/text/TextCodecUTF8.h"
44 #include "wtf/text/TextCodecUserDefined.h" 43 #include "wtf/text/TextCodecUserDefined.h"
45 #include "wtf/text/TextEncoding.h" 44 #include "wtf/text/TextEncoding.h"
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.
52 struct TextEncodingNameHash { 51 struct TextEncodingNameHash {
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 217
219 textCodecMap = new TextCodecMap; 218 textCodecMap = new TextCodecMap;
220 textEncodingNameMap = new TextEncodingNameMap; 219 textEncodingNameMap = new TextEncodingNameMap;
221 220
222 TextCodecLatin1::registerEncodingNames(addToTextEncodingNameMap); 221 TextCodecLatin1::registerEncodingNames(addToTextEncodingNameMap);
223 TextCodecLatin1::registerCodecs(addToTextCodecMap); 222 TextCodecLatin1::registerCodecs(addToTextCodecMap);
224 223
225 TextCodecUTF8::registerEncodingNames(addToTextEncodingNameMap); 224 TextCodecUTF8::registerEncodingNames(addToTextEncodingNameMap);
226 TextCodecUTF8::registerCodecs(addToTextCodecMap); 225 TextCodecUTF8::registerCodecs(addToTextCodecMap);
227 226
228 TextCodecUTF16::registerEncodingNames(addToTextEncodingNameMap);
229 TextCodecUTF16::registerCodecs(addToTextCodecMap);
230
231 TextCodecUserDefined::registerEncodingNames(addToTextEncodingNameMap); 227 TextCodecUserDefined::registerEncodingNames(addToTextEncodingNameMap);
232 TextCodecUserDefined::registerCodecs(addToTextCodecMap); 228 TextCodecUserDefined::registerCodecs(addToTextCodecMap);
233 } 229 }
234 230
235 bool isReplacementEncoding(const char* alias) 231 bool isReplacementEncoding(const char* alias)
236 { 232 {
237 return alias && !strcasecmp(alias, "replacement"); 233 return alias && !strcasecmp(alias, "replacement");
238 } 234 }
239 235
240 bool isReplacementEncoding(const String& alias) 236 bool isReplacementEncoding(const String& alias)
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 MutexLocker lock(encodingRegistryMutex()); 318 MutexLocker lock(encodingRegistryMutex());
323 319
324 TextEncodingNameMap::const_iterator it = textEncodingNameMap->begin(); 320 TextEncodingNameMap::const_iterator it = textEncodingNameMap->begin();
325 TextEncodingNameMap::const_iterator end = textEncodingNameMap->end(); 321 TextEncodingNameMap::const_iterator end = textEncodingNameMap->end();
326 for (; it != end; ++it) 322 for (; it != end; ++it)
327 fprintf(stderr, "'%s' => '%s'\n", it->key, it->value); 323 fprintf(stderr, "'%s' => '%s'\n", it->key, it->value);
328 } 324 }
329 #endif 325 #endif
330 326
331 } // namespace WTF 327 } // namespace WTF
OLDNEW
« no previous file with comments | « Source/wtf/text/TextEncoding.h ('k') | Source/wtf/wtf.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698