Chromium Code Reviews

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

Issue 1715203002: Stop async spellchecker before running the leak detector. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase + parameterize WebLeakDetector over WebFrames instead Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Index: third_party/WebKit/Source/core/editing/spellcheck/SpellCheckRequester.cpp
diff --git a/third_party/WebKit/Source/core/editing/spellcheck/SpellCheckRequester.cpp b/third_party/WebKit/Source/core/editing/spellcheck/SpellCheckRequester.cpp
index 3671c2944d86fdaa7dd5394830b90020b3f45a14..b224719eb16f3b439cef35ff2972ed3a18f0a224 100644
--- a/third_party/WebKit/Source/core/editing/spellcheck/SpellCheckRequester.cpp
+++ b/third_party/WebKit/Source/core/editing/spellcheck/SpellCheckRequester.cpp
@@ -226,6 +226,19 @@ void SpellCheckRequester::cancelCheck()
m_processingRequest->didCancel();
}
+void SpellCheckRequester::prepareForLeakDetection()
+{
+ m_timerToProcessQueuedRequest.stop();
+ // Empty the queue of pending requests to prevent it being a leak source.
+ // Pending spell checker requests are cancellable requests not representing
+ // leaks, just async work items waiting to be processed.
+ //
+ // Rather than somehow wait for this async queue to drain before running
+ // the leak detector, they're all cancelled to prevent flaky leaks being
+ // reported.
+ m_requestQueue.clear();
+}
+
void SpellCheckRequester::invokeRequest(PassRefPtrWillBeRawPtr<SpellCheckRequest> request)
{
ASSERT(!m_processingRequest);

Powered by Google App Engine