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

Unified Diff: third_party/WebKit/Source/core/editing/iterators/TextBufferBase.h

Issue 1687813002: Optimize Boundary Finding with Progressive Text Accumulation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@text_accumulator_push
Patch Set: Created 4 years, 10 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/core/editing/iterators/TextBufferBase.h
diff --git a/third_party/WebKit/Source/core/editing/iterators/TextBufferBase.h b/third_party/WebKit/Source/core/editing/iterators/TextBufferBase.h
index 27f3be0fd5ba9145ffdbbcaa37a14a2409b5ffcc..28d0a6a383dfea382b3e2cf8df13917b6d001e74 100644
--- a/third_party/WebKit/Source/core/editing/iterators/TextBufferBase.h
+++ b/third_party/WebKit/Source/core/editing/iterators/TextBufferBase.h
@@ -18,6 +18,7 @@ public:
void clear() { m_size = 0; }
size_t size() const { return m_size; }
bool isEmpty() const { return m_size == 0; }
+ size_t capacity() const { return m_buffer.capacity(); }
const UChar& operator[](size_t index) const { ASSERT(index < m_size); return data()[index]; }
virtual const UChar* data() const = 0;
@@ -39,7 +40,6 @@ protected:
virtual UChar* calcDestination(size_t length) = 0;
virtual void shiftData(size_t oldCapacity);
- size_t capacity() const { return m_buffer.capacity(); }
const UChar* bufferBegin() const { return m_buffer.begin(); }
const UChar* bufferEnd() const { return m_buffer.end(); }
UChar* bufferBegin() { return m_buffer.begin(); }

Powered by Google App Engine
This is Rietveld 408576698