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

Unified Diff: Source/core/editing/spellcheck/SpellCheckRequester.cpp

Issue 1335573004: Introduce Range::dispose() for prompt detachment from owner Document. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: split out rangeContents() switch 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
« no previous file with comments | « Source/core/editing/spellcheck/SpellCheckRequester.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/spellcheck/SpellCheckRequester.cpp
diff --git a/Source/core/editing/spellcheck/SpellCheckRequester.cpp b/Source/core/editing/spellcheck/SpellCheckRequester.cpp
index a5a99b8e2d641440ee7c76e0e59982527298ba69..acdea4597f8967f6609b5699ebd750859fa50932 100644
--- a/Source/core/editing/spellcheck/SpellCheckRequester.cpp
+++ b/Source/core/editing/spellcheck/SpellCheckRequester.cpp
@@ -211,6 +211,17 @@ void SpellCheckRequester::invokeRequest(PassRefPtrWillBeRawPtr<SpellCheckRequest
client().requestCheckingOfString(m_processingRequest);
}
+void SpellCheckRequester::clearProcessingRequest()
+{
+ // This assumes that m_processingRequest's Ranges aren't shared.
+ if (m_processingRequest->checkingRange())
+ m_processingRequest->checkingRange()->dispose();
+ if (m_processingRequest->paragraphRange())
+ m_processingRequest->paragraphRange()->dispose();
+
+ m_processingRequest.clear();
+}
+
void SpellCheckRequester::enqueueRequest(PassRefPtrWillBeRawPtr<SpellCheckRequest> request)
{
ASSERT(request);
@@ -251,7 +262,7 @@ void SpellCheckRequester::didCheck(int sequence, const Vector<TextCheckingResult
if (m_lastProcessedSequence < sequence)
m_lastProcessedSequence = sequence;
- m_processingRequest.clear();
+ clearProcessingRequest();
if (!m_requestQueue.isEmpty())
m_timerToProcessQueuedRequest.startOneShot(0, FROM_HERE);
}
« no previous file with comments | « Source/core/editing/spellcheck/SpellCheckRequester.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698