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

Unified Diff: third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.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
Index: third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.h
diff --git a/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.h b/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.h
index 9d89fe31d0864e71987578c32b976664ed21cc3a..48d15960197d1099e7449fd7e9019c226bf81f71 100644
--- a/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.h
+++ b/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.h
@@ -19,12 +19,12 @@ class TextIteratorTextState;
// TextIteratorTextNodeHandler extracts plain text from a text node by calling
// HandleTextNode() function. It should be used only by TextIterator.
-class TextIteratorTextNodeHandler final {
- STACK_ALLOCATED();
-
+class TextIteratorTextNodeHandler final
+ : public GarbageCollectedFinalized<TextIteratorTextNodeHandler> {
public:
TextIteratorTextNodeHandler(const TextIteratorBehavior&,
TextIteratorTextState*);
+ ~TextIteratorTextNodeHandler() {}
Text* GetNode() const { return text_node_; }
@@ -44,6 +44,8 @@ class TextIteratorTextNodeHandler final {
void HandleTextNodeEndAt(Text*, int end_offset);
void HandleTextNodeInRange(Text*, int start_offset, int end_offset);
+ DECLARE_TRACE();
+
private:
void HandlePreFormattedTextNode();
void HandleTextBox();
@@ -97,7 +99,7 @@ class TextIteratorTextNodeHandler final {
const TextIteratorBehavior behavior_;
// Contains state of emitted text.
- TextIteratorTextState& text_state_;
+ const Member<TextIteratorTextState> text_state_;
DISALLOW_COPY_AND_ASSIGN(TextIteratorTextNodeHandler);
};

Powered by Google App Engine
This is Rietveld 408576698