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

Unified Diff: Source/core/editing/SpellChecker.cpp

Issue 330383004: Oilpan: Introduce TempRangeScope to avoid needless Range attaches on Document. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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/SpellChecker.cpp
diff --git a/Source/core/editing/SpellChecker.cpp b/Source/core/editing/SpellChecker.cpp
index 3253554d87a7d546ca23273e7532bf11eac85f70..3ad184725ea75070c277a1ddd4f24e6dcb98b5f4 100644
--- a/Source/core/editing/SpellChecker.cpp
+++ b/Source/core/editing/SpellChecker.cpp
@@ -331,6 +331,7 @@ void SpellChecker::markMisspellingsAndBadGrammar(const VisibleSelection &movingS
void SpellChecker::markMisspellingsAfterTypingToWord(const VisiblePosition &wordStart, const VisibleSelection& selectionAfterTyping)
{
+ TempRangeScope scope;
if (unifiedTextCheckerEnabled()) {
TextCheckingTypeMask textCheckingOptions = 0;
@@ -741,11 +742,14 @@ void SpellChecker::respondToChangedSelection(const VisibleSelection& oldSelectio
spellCheckOldSelection(oldSelection, newAdjacentWords, newSelectedSentence);
}
+
if (textChecker().shouldEraseMarkersAfterChangeSelection(TextCheckingTypeSpelling)) {
+ TempRangeScope scope;
if (RefPtrWillBeRawPtr<Range> wordRange = newAdjacentWords.toNormalizedRange())
m_frame.document()->markers().removeMarkers(wordRange.get(), DocumentMarker::Spelling);
}
if (textChecker().shouldEraseMarkersAfterChangeSelection(TextCheckingTypeGrammar)) {
+ TempRangeScope scope;
if (RefPtrWillBeRawPtr<Range> sentenceRange = newSelectedSentence.toNormalizedRange())
m_frame.document()->markers().removeMarkers(sentenceRange.get(), DocumentMarker::Grammar);
}

Powered by Google App Engine
This is Rietveld 408576698