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

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

Issue 265973003: Implement "replacement" text encoding. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Request rebaseline the temporary chaset-replacement output Created 6 years, 7 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/TextCodecUTF8.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 20 matching lines...) Expand all
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 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 return canonicalEncodingName && japaneseEncodings && japaneseEncodings->cont ains(canonicalEncodingName); 269 return canonicalEncodingName && japaneseEncodings && japaneseEncodings->cont ains(canonicalEncodingName);
269 } 270 }
270 271
271 bool shouldShowBackslashAsCurrencySymbolIn(const char* canonicalEncodingName) 272 bool shouldShowBackslashAsCurrencySymbolIn(const char* canonicalEncodingName)
272 { 273 {
273 return canonicalEncodingName && nonBackslashEncodings && nonBackslashEncodin gs->contains(canonicalEncodingName); 274 return canonicalEncodingName && nonBackslashEncodings && nonBackslashEncodin gs->contains(canonicalEncodingName);
274 } 275 }
275 276
276 static void extendTextCodecMaps() 277 static void extendTextCodecMaps()
277 { 278 {
279 TextCodecReplacement::registerEncodingNames(addToTextEncodingNameMap);
280 TextCodecReplacement::registerCodecs(addToTextCodecMap);
281
278 TextCodecICU::registerEncodingNames(addToTextEncodingNameMap); 282 TextCodecICU::registerEncodingNames(addToTextEncodingNameMap);
279 TextCodecICU::registerCodecs(addToTextCodecMap); 283 TextCodecICU::registerCodecs(addToTextCodecMap);
280 284
281 pruneBlacklistedCodecs(); 285 pruneBlacklistedCodecs();
282 buildQuirksSets(); 286 buildQuirksSets();
283 } 287 }
284 288
285 PassOwnPtr<TextCodec> newTextCodec(const TextEncoding& encoding) 289 PassOwnPtr<TextCodec> newTextCodec(const TextEncoding& encoding)
286 { 290 {
287 MutexLocker lock(encodingRegistryMutex()); 291 MutexLocker lock(encodingRegistryMutex());
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 MutexLocker lock(encodingRegistryMutex()); 355 MutexLocker lock(encodingRegistryMutex());
352 356
353 TextEncodingNameMap::const_iterator it = textEncodingNameMap->begin(); 357 TextEncodingNameMap::const_iterator it = textEncodingNameMap->begin();
354 TextEncodingNameMap::const_iterator end = textEncodingNameMap->end(); 358 TextEncodingNameMap::const_iterator end = textEncodingNameMap->end();
355 for (; it != end; ++it) 359 for (; it != end; ++it)
356 fprintf(stderr, "'%s' => '%s'\n", it->key, it->value); 360 fprintf(stderr, "'%s' => '%s'\n", it->key, it->value);
357 } 361 }
358 #endif 362 #endif
359 363
360 } // namespace WTF 364 } // namespace WTF
OLDNEW
« no previous file with comments | « Source/wtf/text/TextCodecUTF8.h ('k') | Source/wtf/wtf.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698