OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All Rights Reserved. | 2 * Copyright (C) 2010 Google 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 m_doneChecking(false) {} | 45 m_doneChecking(false) {} |
46 | 46 |
47 HTMLMetaCharsetParser::~HTMLMetaCharsetParser() {} | 47 HTMLMetaCharsetParser::~HTMLMetaCharsetParser() {} |
48 | 48 |
49 bool HTMLMetaCharsetParser::processMeta() { | 49 bool HTMLMetaCharsetParser::processMeta() { |
50 const HTMLToken::AttributeList& tokenAttributes = m_token.attributes(); | 50 const HTMLToken::AttributeList& tokenAttributes = m_token.attributes(); |
51 HTMLAttributeList attributes; | 51 HTMLAttributeList attributes; |
52 for (const HTMLToken::Attribute& tokenAttribute : tokenAttributes) { | 52 for (const HTMLToken::Attribute& tokenAttribute : tokenAttributes) { |
53 String attributeName = tokenAttribute.nameAttemptStaticStringCreation(); | 53 String attributeName = tokenAttribute.nameAttemptStaticStringCreation(); |
54 String attributeValue = tokenAttribute.value8BitIfNecessary(); | 54 String attributeValue = tokenAttribute.value8BitIfNecessary(); |
55 attributes.append(std::make_pair(attributeName, attributeValue)); | 55 attributes.push_back(std::make_pair(attributeName, attributeValue)); |
56 } | 56 } |
57 | 57 |
58 m_encoding = encodingFromMetaAttributes(attributes); | 58 m_encoding = encodingFromMetaAttributes(attributes); |
59 return m_encoding.isValid(); | 59 return m_encoding.isValid(); |
60 } | 60 } |
61 | 61 |
62 // That many input bytes will be checked for meta charset even if <head> section | 62 // That many input bytes will be checked for meta charset even if <head> section |
63 // is over. | 63 // is over. |
64 static const int bytesToCheckUnconditionally = 1024; | 64 static const int bytesToCheckUnconditionally = 1024; |
65 | 65 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 return true; | 121 return true; |
122 } | 122 } |
123 | 123 |
124 m_token.clear(); | 124 m_token.clear(); |
125 } | 125 } |
126 | 126 |
127 return false; | 127 return false; |
128 } | 128 } |
129 | 129 |
130 } // namespace blink | 130 } // namespace blink |
OLD | NEW |