Chromium Code Reviews| 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 |