| Index: third_party/WebKit/Source/platform/text/SegmentedString.h
|
| diff --git a/third_party/WebKit/Source/platform/text/SegmentedString.h b/third_party/WebKit/Source/platform/text/SegmentedString.h
|
| index 49f00fab74dedfefba7429f5165e6ea9da23c8b1..c803031fcc4eb89171fc247b07954f5e108a1f14 100644
|
| --- a/third_party/WebKit/Source/platform/text/SegmentedString.h
|
| +++ b/third_party/WebKit/Source/platform/text/SegmentedString.h
|
| @@ -127,11 +127,28 @@ class PLATFORM_EXPORT SegmentedSubstring {
|
| return *++m_data.string16Ptr;
|
| }
|
|
|
| + UChar getCharByIndex8(unsigned index) {
|
| + ASSERT(m_data.string8Ptr);
|
| + m_data.string8Ptr += index;
|
| + return *m_data.string8Ptr;
|
| + }
|
| +
|
| + UChar getCharByIndex16(unsigned index) {
|
| + ASSERT(m_data.string16Ptr);
|
| + m_data.string16Ptr += index;
|
| + return *m_data.string16Ptr;
|
| + }
|
| +
|
| String currentSubString(unsigned length) {
|
| int offset = m_string.length() - m_length;
|
| return m_string.substring(offset, length);
|
| }
|
|
|
| + String currentSubString(unsigned pos, unsigned length) {
|
| + int offset = m_string.length() - m_length + pos;
|
| + return m_string.substring(offset, length);
|
| + }
|
| +
|
| ALWAYS_INLINE UChar getCurrentChar() {
|
| ASSERT(m_length);
|
| if (is8Bit())
|
| @@ -146,6 +163,13 @@ class PLATFORM_EXPORT SegmentedSubstring {
|
| return incrementAndGetCurrentChar16();
|
| }
|
|
|
| + ALWAYS_INLINE UChar getCharByIndex(unsigned index) {
|
| + ASSERT(m_length - index);
|
| + if (is8Bit())
|
| + return getCharByIndex8(index);
|
| + return getCharByIndex16(index);
|
| + }
|
| +
|
| ALWAYS_INLINE bool haveOneCharacterLeft() const { return m_length == 1; }
|
|
|
| ALWAYS_INLINE void decrementLength() { --m_length; }
|
| @@ -303,6 +327,25 @@ class PLATFORM_EXPORT SegmentedString {
|
| String toString() const;
|
|
|
| UChar currentChar() const { return m_currentChar; }
|
| + SegmentedSubstring getCurrentString() const { return m_currentString; }
|
| +
|
| + String getCurrentSubstring(unsigned length) {
|
| + return m_currentString.currentSubString(length);
|
| + }
|
| +
|
| + String getCurrentSubstring(unsigned pos, unsigned length) {
|
| + return m_currentString.currentSubString(pos, length);
|
| + }
|
| +
|
| + bool isEqualToScriptStartTagTemplate(const String& str) {
|
| + String stringTemplate("<script");
|
| + return equalPossiblyIgnoringCase(stringTemplate, str, true);
|
| + }
|
| +
|
| + bool isEqualToScriptEndTagTemplate(const String& str) {
|
| + String stringTemplate("</script>");
|
| + return equalPossiblyIgnoringCase(stringTemplate, str, true);
|
| + }
|
|
|
| // The method is moderately slow, comparing to currentLine method.
|
| OrdinalNumber currentColumn() const;
|
|
|