Index: third_party/WebKit/Source/core/css/parser/CSSParserString.h |
diff --git a/third_party/WebKit/Source/core/css/parser/CSSParserString.h b/third_party/WebKit/Source/core/css/parser/CSSParserString.h |
index 7b868fd9aee88e46c143b17e88e2ddc28e78bff4..58c12ed30a32903f7a5b4aeb15f5447809514b86 100644 |
--- a/third_party/WebKit/Source/core/css/parser/CSSParserString.h |
+++ b/third_party/WebKit/Source/core/css/parser/CSSParserString.h |
@@ -23,6 +23,7 @@ |
#include "wtf/Allocator.h" |
#include "wtf/text/AtomicString.h" |
+#include "wtf/text/StringView.h" |
#include "wtf/text/WTFString.h" |
namespace blink { |
@@ -89,9 +90,12 @@ struct CSSParserString { |
return is8Bit() ? WTF::equalIgnoringASCIICase(characters8(), match, length()) : WTF::equalIgnoringASCIICase(characters16(), match, length()); |
} |
+ // TODO(esprehn): Remove both of these implicit operators, they're very expensive. |
operator String() const { return is8Bit() ? String(m_data.characters8, m_length) : StringImpl::create8BitIfPossible(m_data.characters16, m_length); } |
operator AtomicString() const { return is8Bit() ? AtomicString(m_data.characters8, m_length) : AtomicString(m_data.characters16, m_length); } |
+ operator StringView() const { return is8Bit() ? StringView(m_data.characters8, m_length) : StringView(m_data.characters16, m_length); } |
+ |
union { |
const LChar* characters8; |
const UChar* characters16; |