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

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

Issue 1604783002: ALL-IN-ONE: Optimization to previousBoundary() and nextBoundary() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@progressive_accumulator
Patch Set: Created 4 years, 11 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/TextIterator.h
diff --git a/third_party/WebKit/Source/core/editing/iterators/TextIterator.h b/third_party/WebKit/Source/core/editing/iterators/TextIterator.h
index 8bd09c39469c403d60846e96eb837ca11d69174c..785d0e8f85d6805423aa513851eb0db19ad2eb63 100644
--- a/third_party/WebKit/Source/core/editing/iterators/TextIterator.h
+++ b/third_party/WebKit/Source/core/editing/iterators/TextIterator.h
@@ -82,16 +82,8 @@ public:
// Calculate the minimum |actualLength >= minLength| such that code units
// with offset range [position, position + actualLength) are whole code
// points. Append these code points to |output| and return |actualLength|.
- template<typename BufferType>
- int copyTextTo(BufferType& output, int position, int minLength) const
- {
- int copiedLength = isBetweenSurrogatePair(position + minLength) ? minLength + 1 : minLength;
- copyCodeUnitsTo(output, position, copiedLength);
- return copiedLength;
- }
-
- template<typename BufferType>
- int copyTextTo(BufferType& output, int position = 0) const { return copyTextTo(output, position, length() - position); }
+ int copyTextTo(ForwardsTextBuffer& output, int position, int minLength) const;
+ int copyTextTo(ForwardsTextBuffer& output, int position = 0) const;
// Computes the length of the given range using a text iterator. The default
// iteration behavior is to always emit object replacement characters for
@@ -159,8 +151,7 @@ private:
// Append code units with offset range [position, position + copyLength)
// to the output buffer.
- template<typename BufferType>
- void copyCodeUnitsTo(BufferType& output, int position, int copyLength) const { m_textState.appendTextTo(output, position, copyLength); }
+ void copyCodeUnitsTo(ForwardsTextBuffer& output, int position, int copyLength) const;
// Current position, not necessarily of the text being returned, but position
// as we walk through the DOM tree.

Powered by Google App Engine
This is Rietveld 408576698