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

Unified Diff: Source/core/html/parser/HTMLMetaCharsetParser.cpp

Issue 74513003: Moved text decoding to the parser thread (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@parserthread_step25
Patch Set: Removed AtomicString from HTMLMetaCharsetParser Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/html/parser/HTMLMetaCharsetParser.cpp
diff --git a/Source/core/html/parser/HTMLMetaCharsetParser.cpp b/Source/core/html/parser/HTMLMetaCharsetParser.cpp
index 7f3c34d8905f201df53691c8e553ecde81550871..7b0524513381cfc6d84b82cb0cda55a198823d89 100644
--- a/Source/core/html/parser/HTMLMetaCharsetParser.cpp
+++ b/Source/core/html/parser/HTMLMetaCharsetParser.cpp
@@ -106,7 +106,7 @@ bool HTMLMetaCharsetParser::processMeta()
const HTMLToken::AttributeList& tokenAttributes = m_token.attributes();
AttributeList attributes;
for (HTMLToken::AttributeList::const_iterator iter = tokenAttributes.begin(); iter != tokenAttributes.end(); ++iter) {
- String attributeName = StringImpl::create8BitIfPossible(iter->name);
+ HTMLIdentifier attributeName(iter->name, Likely8Bit);
String attributeValue = StringImpl::create8BitIfPossible(iter->value);
attributes.append(std::make_pair(attributeName, attributeValue));
}
@@ -122,17 +122,17 @@ WTF::TextEncoding HTMLMetaCharsetParser::encodingFromMetaAttributes(const Attrib
String charset;
for (AttributeList::const_iterator iter = attributes.begin(); iter != attributes.end(); ++iter) {
- const AtomicString& attributeName = iter->first;
+ const HTMLIdentifier& attributeName = iter->first;
const String& attributeValue = iter->second;
- if (attributeName == http_equivAttr) {
+ if (threadSafeMatch(attributeName, http_equivAttr)) {
if (equalIgnoringCase(attributeValue, "content-type"))
gotPragma = true;
} else if (charset.isEmpty()) {
- if (attributeName == charsetAttr) {
+ if (threadSafeMatch(attributeName, charsetAttr)) {
charset = attributeValue;
mode = Charset;
- } else if (attributeName == contentAttr) {
+ } else if (threadSafeMatch(attributeName, contentAttr)) {
charset = extractCharset(attributeValue);
if (charset.length())
mode = Pragma;
@@ -178,7 +178,7 @@ bool HTMLMetaCharsetParser::checkForMetaCharset(const char* data, size_t length)
while (m_tokenizer->nextToken(m_input, m_token)) {
bool end = m_token.type() == HTMLToken::EndTag;
if (end || m_token.type() == HTMLToken::StartTag) {
- AtomicString tagName(m_token.name());
+ HTMLIdentifier tagName(m_token.name(), Likely8Bit);
if (!end) {
m_tokenizer->updateStateFor(tagName);
if (tagName == metaTag && processMeta()) {

Powered by Google App Engine
This is Rietveld 408576698