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

Unified Diff: Source/core/editing/spellcheck/TextCheckingHelper.h

Issue 1329253002: WIP: prefer using EphemeralRange for SpellChecker. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: introduce Range::dispose() Created 5 years, 3 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: Source/core/editing/spellcheck/TextCheckingHelper.h
diff --git a/Source/core/editing/spellcheck/TextCheckingHelper.h b/Source/core/editing/spellcheck/TextCheckingHelper.h
index 12647a20cd15f269f39b98ebfb78a6a66d96df59..643f8f63b399df9516fb3b240dd4eeb3949eebe1 100644
--- a/Source/core/editing/spellcheck/TextCheckingHelper.h
+++ b/Source/core/editing/spellcheck/TextCheckingHelper.h
@@ -21,6 +21,7 @@
#ifndef TextCheckingHelper_h
#define TextCheckingHelper_h
+#include "core/editing/EphemeralRange.h"
#include "core/editing/Position.h"
#include "platform/heap/Handle.h"
#include "platform/text/TextChecking.h"
@@ -38,12 +39,13 @@ struct TextCheckingResult;
class TextCheckingParagraph {
STACK_ALLOCATED();
public:
- explicit TextCheckingParagraph(PassRefPtrWillBeRawPtr<Range> checkingRange);
+ explicit TextCheckingParagraph(const EphemeralRange checkingRange);
+ TextCheckingParagraph(const EphemeralRange checkingRange, const EphemeralRange paragraphRange);
TextCheckingParagraph(PassRefPtrWillBeRawPtr<Range> checkingRange, PassRefPtrWillBeRawPtr<Range> paragraphRange);
~TextCheckingParagraph();
int rangeLength() const;
- PassRefPtrWillBeRawPtr<Range> subrange(int characterOffset, int characterCount) const;
+ EphemeralRange subrange(int characterOffset, int characterCount) const;
int offsetTo(const Position&, ExceptionState&) const;
void expandRangeToNextEnd();
@@ -61,16 +63,17 @@ public:
int checkingLength() const;
bool checkingRangeCovers(int location, int length) const { return location < checkingEnd() && location + length > checkingStart(); }
- PassRefPtrWillBeRawPtr<Range> paragraphRange() const;
- PassRefPtrWillBeRawPtr<Range> checkingRange() const { return m_checkingRange; }
+ EphemeralRange paragraphRange() const;
+ EphemeralRange checkingRange() const { return m_checkingRange; }
+ void setParagraphRange(const EphemeralRange&);
private:
void invalidateParagraphRangeValues();
- PassRefPtrWillBeRawPtr<Range> offsetAsRange() const;
+ EphemeralRange offsetAsRange() const;
- RefPtrWillBeMember<Range> m_checkingRange;
- mutable RefPtrWillBeMember<Range> m_paragraphRange;
- mutable RefPtrWillBeMember<Range> m_offsetAsRange;
+ EphemeralRange m_checkingRange;
+ mutable EphemeralRange m_paragraphRange;
yosin_UTC9 2015/09/10 01:58:39 Good catch! Since, |EphmeralRange| checks DOM tre
+ mutable EphemeralRange m_offsetAsRange;
mutable String m_text;
mutable int m_checkingStart;
mutable int m_checkingEnd;
@@ -100,7 +103,7 @@ private:
};
void checkTextOfParagraph(TextCheckerClient&, const String&, TextCheckingTypeMask, Vector<TextCheckingResult>&);
-void expandRangeToSentenceBoundary(Range&);
+EphemeralRange expandRangeToSentenceBoundary(const EphemeralRange&);
bool unifiedTextCheckerEnabled(const LocalFrame*);
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698