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

Unified Diff: third_party/WebKit/Source/platform/text/SegmentedString.h

Issue 2127043002: SegmentedString::prepend should know if the prepended string is new or previously consumed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months 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: 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 cd71e6a931db9b0b70f2729f88bb962d2a8ba5ab..8a80cdb17b4447be0fd745f1b66335453957db41 100644
--- a/third_party/WebKit/Source/platform/text/SegmentedString.h
+++ b/third_party/WebKit/Source/platform/text/SegmentedString.h
@@ -211,7 +211,11 @@ public:
void close();
void append(const SegmentedString&);
- void prepend(const SegmentedString&);
+ enum class PrependType {
+ NewInput = 0,
+ Unconsume = 1,
+ };
+ void prepend(const SegmentedString&, PrependType);
bool excludeLineNumbers() const { return m_currentString.excludeLineNumbers(); }
void setExcludeLineNumbers();
@@ -323,7 +327,7 @@ private:
};
void append(const SegmentedSubstring&);
- void prepend(const SegmentedSubstring&);
+ void prepend(const SegmentedSubstring&, PrependType);
void advance8();
void advance16();
@@ -399,7 +403,7 @@ private:
LookAheadResult result = DidNotMatch;
if (consumedString.startsWith(string, caseSensitivity))
result = DidMatch;
- prepend(SegmentedString(consumedString));
+ prepend(SegmentedString(consumedString), PrependType::Unconsume);
return result;
}

Powered by Google App Engine
This is Rietveld 408576698