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

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

Issue 2373983006: reflow comments in wtf/text (Closed)
Patch Set: Created 4 years, 2 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
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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 strcasecmp(atomicName, "iso-8859-8") == 0) 138 strcasecmp(atomicName, "iso-8859-8") == 0)
139 return; 139 return;
140 LOG(ERROR) << "alias " << alias << " maps to " << oldAtomicName 140 LOG(ERROR) << "alias " << alias << " maps to " << oldAtomicName
141 << " already, but someone is trying to make it map to " 141 << " already, but someone is trying to make it map to "
142 << atomicName; 142 << atomicName;
143 } 143 }
144 144
145 #endif 145 #endif
146 146
147 static bool isUndesiredAlias(const char* alias) { 147 static bool isUndesiredAlias(const char* alias) {
148 // Reject aliases with version numbers that are supported by some back-ends (s uch as "ISO_2022,locale=ja,version=0" in ICU). 148 // Reject aliases with version numbers that are supported by some back-ends
149 // (such as "ISO_2022,locale=ja,version=0" in ICU).
149 for (const char* p = alias; *p; ++p) { 150 for (const char* p = alias; *p; ++p) {
150 if (*p == ',') 151 if (*p == ',')
151 return true; 152 return true;
152 } 153 }
153 // 8859_1 is known to (at least) ICU, but other browsers don't support this na me - and having it caused a compatibility 154 // 8859_1 is known to (at least) ICU, but other browsers don't support this
155 // name - and having it caused a compatibility
154 // problem, see bug 43554. 156 // problem, see bug 43554.
155 if (0 == strcmp(alias, "8859_1")) 157 if (0 == strcmp(alias, "8859_1"))
156 return true; 158 return true;
157 return false; 159 return false;
158 } 160 }
159 161
160 static void addToTextEncodingNameMap(const char* alias, const char* name) { 162 static void addToTextEncodingNameMap(const char* alias, const char* name) {
161 ASSERT(strlen(alias) <= maxEncodingNameLength); 163 ASSERT(strlen(alias) <= maxEncodingNameLength);
162 if (isUndesiredAlias(alias)) 164 if (isUndesiredAlias(alias))
163 return; 165 return;
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 MutexLocker lock(encodingRegistryMutex()); 307 MutexLocker lock(encodingRegistryMutex());
306 308
307 TextEncodingNameMap::const_iterator it = textEncodingNameMap->begin(); 309 TextEncodingNameMap::const_iterator it = textEncodingNameMap->begin();
308 TextEncodingNameMap::const_iterator end = textEncodingNameMap->end(); 310 TextEncodingNameMap::const_iterator end = textEncodingNameMap->end();
309 for (; it != end; ++it) 311 for (; it != end; ++it)
310 fprintf(stderr, "'%s' => '%s'\n", it->key, it->value); 312 fprintf(stderr, "'%s' => '%s'\n", it->key, it->value);
311 } 313 }
312 #endif 314 #endif
313 315
314 } // namespace WTF 316 } // namespace WTF
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698