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

Unified Diff: third_party/WebKit/Source/core/editing/spellcheck/HotModeSpellCheckRequester.cpp

Issue 2734393003: Correct usage of text iterator in idle time spellchecker (Closed)
Patch Set: Remove TODO Created 3 years, 9 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 | 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/spellcheck/HotModeSpellCheckRequester.cpp
diff --git a/third_party/WebKit/Source/core/editing/spellcheck/HotModeSpellCheckRequester.cpp b/third_party/WebKit/Source/core/editing/spellcheck/HotModeSpellCheckRequester.cpp
index 3b106ceba3650c104d0a449ab02ff6dc54518adb..845cd1fdd96082b558c0a7634a6b1b7acae63521 100644
--- a/third_party/WebKit/Source/core/editing/spellcheck/HotModeSpellCheckRequester.cpp
+++ b/third_party/WebKit/Source/core/editing/spellcheck/HotModeSpellCheckRequester.cpp
@@ -73,11 +73,13 @@ EphemeralRange calculateHotModeCheckingRange(const Element& editable,
.build();
BackwardsCharacterIterator backwardIterator(fullRange.startPosition(),
position, behavior);
- backwardIterator.advance(kHotModeChunkSize / 2);
+ if (!backwardIterator.atEnd())
+ backwardIterator.advance(kHotModeChunkSize / 2);
const Position& chunkStart = backwardIterator.endPosition();
CharacterIterator forwardIterator(position, fullRange.endPosition(),
behavior);
- forwardIterator.advance(kHotModeChunkSize / 2);
+ if (!forwardIterator.atEnd())
+ forwardIterator.advance(kHotModeChunkSize / 2);
const Position& chunkEnd = forwardIterator.endPosition();
return expandRangeToSentenceBoundary(EphemeralRange(chunkStart, chunkEnd));
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698