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

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

Issue 2919453002: Expand TextIterator::Initialize() into constructor (Closed)
Patch Set: 2017-05-31T16:15:33 Created 3 years, 7 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
« no previous file with comments | « third_party/WebKit/Source/core/editing/iterators/TextIterator.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp
diff --git a/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp b/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp
index 51ca7fe6cd7a5daa51146665acdd5ce2558fab8b..53fb8b55e1f22fe4412984634604f6d4c0c5e28a 100644
--- a/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp
+++ b/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp
@@ -147,6 +147,14 @@ bool IsRenderedAsTable(const Node* node) {
template <typename Strategy>
TextIteratorAlgorithm<Strategy>::TextIteratorAlgorithm(
+ const EphemeralRangeTemplate<Strategy>& range,
+ const TextIteratorBehavior& behavior)
+ : TextIteratorAlgorithm(range.StartPosition(),
+ range.EndPosition(),
+ behavior) {}
+
+template <typename Strategy>
+TextIteratorAlgorithm<Strategy>::TextIteratorAlgorithm(
const PositionTemplate<Strategy>& start,
const PositionTemplate<Strategy>& end,
const TextIteratorBehavior& behavior)
@@ -173,25 +181,11 @@ TextIteratorAlgorithm<Strategy>::TextIteratorAlgorithm(
// To avoid renderer hang, we use |CHECK_LE()| to catch the bad callers
// in release build.
CHECK_LE(start, end);
- Initialize(start.ComputeContainerNode(), start.ComputeOffsetInContainerNode(),
- end.ComputeContainerNode(), end.ComputeOffsetInContainerNode());
-}
-template <typename Strategy>
-TextIteratorAlgorithm<Strategy>::TextIteratorAlgorithm(
- const EphemeralRangeTemplate<Strategy>& range,
- const TextIteratorBehavior& behavior)
- : TextIteratorAlgorithm(range.StartPosition(),
- range.EndPosition(),
- behavior) {}
-
-template <typename Strategy>
-void TextIteratorAlgorithm<Strategy>::Initialize(Node* start_container,
- int start_offset,
- Node* end_container,
- int end_offset) {
- DCHECK(start_container);
- DCHECK(end_container);
+ Node* const start_container = start.ComputeContainerNode();
+ const int start_offset = start.ComputeOffsetInContainerNode();
+ Node* const end_container = end.ComputeContainerNode();
+ const int end_offset = end.ComputeOffsetInContainerNode();
text_node_handler_.Initialize(start_container, start_offset, end_container,
end_offset);
« no previous file with comments | « third_party/WebKit/Source/core/editing/iterators/TextIterator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698