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

Unified Diff: Source/core/html/parser/HTMLIdentifier.h

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/HTMLIdentifier.h
diff --git a/Source/core/html/parser/HTMLIdentifier.h b/Source/core/html/parser/HTMLIdentifier.h
index 003401314234ae5f0dfa3c35500594457900f15d..92af4ed97237364c660db60fd07c78a0fb632c53 100644
--- a/Source/core/html/parser/HTMLIdentifier.h
+++ b/Source/core/html/parser/HTMLIdentifier.h
@@ -56,6 +56,19 @@ public:
m_string = String(vector);
}
+ HTMLIdentifier(const AtomicString& str, CharacterWidth width)
abarth-chromium 2013/11/27 18:18:08 str -> string Please use complete works in variab
oystein (OOO til 10th of July) 2013/11/27 18:46:33 Done.
+ : m_string(findIfKnown(str.characters16(), str.length()))
abarth-chromium 2013/11/27 18:18:08 How do you know it's safe to call characters16? W
oystein (OOO til 10th of July) 2013/11/27 18:46:33 This is only ever used by the QualifiedName -> HTM
+ {
+ if (m_string.impl())
+ return;
+ if (width == Likely8Bit)
+ m_string = StringImpl::create8BitIfPossible(str.characters16(), str.length());
+ else if (width == Force8Bit)
+ m_string = String::make8BitFrom16BitSource(str.characters16(), str.length());
+ else
+ m_string = str;
+ }
+
// asString should only be used on the main thread.
const String& asString() const;
// asStringImpl() is safe to call from any thread.
@@ -65,6 +78,9 @@ public:
bool isSafeToSendToAnotherThread() const { return m_string.isSafeToSendToAnotherThread(); }
+ bool operator==(const QualifiedName&) const;
+ bool operator!=(const QualifiedName& b) const;
abarth-chromium 2013/11/27 18:18:08 Why does one of these functions have a formal para
oystein (OOO til 10th of July) 2013/11/27 18:46:33 Hm what ambiguity is there when comparing a Qualif
+
#ifndef NDEBUG
static bool isKnown(const StringImpl*);
#endif

Powered by Google App Engine
This is Rietveld 408576698