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

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

Issue 2915043004: Put TextIteratorTextNodeHandler and TextIteratorTextState on heap (Closed)
Patch Set: const Member<> 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 | « no previous file | third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp » ('j') | 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.h
diff --git a/third_party/WebKit/Source/core/editing/iterators/TextIterator.h b/third_party/WebKit/Source/core/editing/iterators/TextIterator.h
index f2e00dcfd2f539f77672efe3d69ecd247d0f9234..6a1037e52a7b64706fef62dfd73cbec5b3fd7b90 100644
--- a/third_party/WebKit/Source/core/editing/iterators/TextIterator.h
+++ b/third_party/WebKit/Source/core/editing/iterators/TextIterator.h
@@ -32,12 +32,13 @@
#include "core/editing/FindOptions.h"
#include "core/editing/iterators/FullyClippedStateStack.h"
#include "core/editing/iterators/TextIteratorBehavior.h"
-#include "core/editing/iterators/TextIteratorTextNodeHandler.h"
#include "core/editing/iterators/TextIteratorTextState.h"
#include "platform/heap/Handle.h"
namespace blink {
+class TextIteratorTextNodeHandler;
+
CORE_EXPORT String
PlainText(const EphemeralRange&,
const TextIteratorBehavior& = TextIteratorBehavior());
@@ -67,7 +68,7 @@ class CORE_TEMPLATE_CLASS_EXPORT TextIteratorAlgorithm {
~TextIteratorAlgorithm();
- bool AtEnd() const { return !text_state_.PositionNode() || should_stop_; }
+ bool AtEnd() const { return !text_state_->PositionNode() || should_stop_; }
void Advance();
bool IsInsideAtomicInlineElement() const;
bool IsInTextSecurityMode() const;
@@ -82,10 +83,10 @@ class CORE_TEMPLATE_CLASS_EXPORT TextIteratorAlgorithm {
PositionTemplate<Strategy> StartPositionInCurrentContainer() const;
PositionTemplate<Strategy> EndPositionInCurrentContainer() const;
- const TextIteratorTextState& GetText() const { return text_state_; }
- int length() const { return text_state_.length(); }
+ const TextIteratorTextState& GetText() const { return *text_state_; }
+ int length() const { return text_state_->length(); }
UChar CharacterAt(unsigned index) const {
- return text_state_.CharacterAt(index);
+ return text_state_->CharacterAt(index);
}
bool BreaksAtReplacedElement() {
@@ -228,12 +229,10 @@ class CORE_TEMPLATE_CLASS_EXPORT TextIteratorAlgorithm {
bool handle_shadow_root_ = false;
// Contains state of emitted text.
- TextIteratorTextState text_state_;
+ const Member<TextIteratorTextState> text_state_;
// Helper for extracting text content from text nodes.
- // TODO(xiaochengh): We should store a pointer here, so that we can use
- // forward declaration and switch it to Layout NG easier.
- TextIteratorTextNodeHandler text_node_handler_;
+ const Member<TextIteratorTextNodeHandler> text_node_handler_;
};
extern template class CORE_EXTERN_TEMPLATE_EXPORT
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698