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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 continue; | 185 continue; |
186 | 186 |
187 Vector<const char*> names; | 187 Vector<const char*> names; |
188 TextEncodingNameMap::const_iterator it = textEncodingNameMap->begin(); | 188 TextEncodingNameMap::const_iterator it = textEncodingNameMap->begin(); |
189 TextEncodingNameMap::const_iterator end = textEncodingNameMap->end(); | 189 TextEncodingNameMap::const_iterator end = textEncodingNameMap->end(); |
190 for (; it != end; ++it) { | 190 for (; it != end; ++it) { |
191 if (it->value == atomicName) | 191 if (it->value == atomicName) |
192 names.append(it->key); | 192 names.append(it->key); |
193 } | 193 } |
194 | 194 |
195 size_t length = names.size(); | 195 textEncodingNameMap->removeAll(names); |
196 for (size_t j = 0; j < length; ++j) | |
197 textEncodingNameMap->remove(names[j]); | |
198 | 196 |
199 textCodecMap->remove(atomicName); | 197 textCodecMap->remove(atomicName); |
200 } | 198 } |
201 } | 199 } |
202 | 200 |
203 static void buildBaseTextCodecMaps() | 201 static void buildBaseTextCodecMaps() |
204 { | 202 { |
205 ASSERT(isMainThread()); | 203 ASSERT(isMainThread()); |
206 ASSERT(!textCodecMap); | 204 ASSERT(!textCodecMap); |
207 ASSERT(!textEncodingNameMap); | 205 ASSERT(!textEncodingNameMap); |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 MutexLocker lock(encodingRegistryMutex()); | 351 MutexLocker lock(encodingRegistryMutex()); |
354 | 352 |
355 TextEncodingNameMap::const_iterator it = textEncodingNameMap->begin(); | 353 TextEncodingNameMap::const_iterator it = textEncodingNameMap->begin(); |
356 TextEncodingNameMap::const_iterator end = textEncodingNameMap->end(); | 354 TextEncodingNameMap::const_iterator end = textEncodingNameMap->end(); |
357 for (; it != end; ++it) | 355 for (; it != end; ++it) |
358 fprintf(stderr, "'%s' => '%s'\n", it->key, it->value); | 356 fprintf(stderr, "'%s' => '%s'\n", it->key, it->value); |
359 } | 357 } |
360 #endif | 358 #endif |
361 | 359 |
362 } // namespace WTF | 360 } // namespace WTF |
OLD | NEW |