OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2010 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 Charset, | 318 Charset, |
319 Pragma, | 319 Pragma, |
320 }; | 320 }; |
321 | 321 |
322 WTF::TextEncoding encodingFromMetaAttributes(const HTMLAttributeList& attributes
) | 322 WTF::TextEncoding encodingFromMetaAttributes(const HTMLAttributeList& attributes
) |
323 { | 323 { |
324 bool gotPragma = false; | 324 bool gotPragma = false; |
325 Mode mode = None; | 325 Mode mode = None; |
326 String charset; | 326 String charset; |
327 | 327 |
328 for (HTMLAttributeList::const_iterator iter = attributes.begin(); iter != at
tributes.end(); ++iter) { | 328 for (const auto& htmlAttribute : attributes) { |
329 const String& attributeName = iter->first; | 329 const String& attributeName = htmlAttribute.first; |
330 const String& attributeValue = AtomicString(iter->second); | 330 const String& attributeValue = AtomicString(htmlAttribute.second); |
331 | 331 |
332 if (threadSafeMatch(attributeName, http_equivAttr)) { | 332 if (threadSafeMatch(attributeName, http_equivAttr)) { |
333 if (equalIgnoringCase(attributeValue, "content-type")) | 333 if (equalIgnoringCase(attributeValue, "content-type")) |
334 gotPragma = true; | 334 gotPragma = true; |
335 } else if (charset.isEmpty()) { | 335 } else if (charset.isEmpty()) { |
336 if (threadSafeMatch(attributeName, charsetAttr)) { | 336 if (threadSafeMatch(attributeName, charsetAttr)) { |
337 charset = attributeValue; | 337 charset = attributeValue; |
338 mode = Charset; | 338 mode = Charset; |
339 } else if (threadSafeMatch(attributeName, contentAttr)) { | 339 } else if (threadSafeMatch(attributeName, contentAttr)) { |
340 charset = extractCharset(attributeValue); | 340 charset = extractCharset(attributeValue); |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
409 string = StringImpl::create8BitIfPossible(characters, size); | 409 string = StringImpl::create8BitIfPossible(characters, size); |
410 else if (width == Force8Bit) | 410 else if (width == Force8Bit) |
411 string = String::make8BitFrom16BitSource(characters, size); | 411 string = String::make8BitFrom16BitSource(characters, size); |
412 else | 412 else |
413 string = String(characters, size); | 413 string = String(characters, size); |
414 | 414 |
415 return string; | 415 return string; |
416 } | 416 } |
417 | 417 |
418 } | 418 } |
OLD | NEW |