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

Side by Side 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. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 219
220 invokeRequest(request); 220 invokeRequest(request);
221 } 221 }
222 222
223 void SpellCheckRequester::cancelCheck() 223 void SpellCheckRequester::cancelCheck()
224 { 224 {
225 if (m_processingRequest) 225 if (m_processingRequest)
226 m_processingRequest->didCancel(); 226 m_processingRequest->didCancel();
227 } 227 }
228 228
229 void SpellCheckRequester::prepareForLeakDetection()
230 {
231 m_timerToProcessQueuedRequest.stop();
232 // Empty the queue of pending requests to prevent it being a leak source.
233 // Pending spell checker requests are cancellable requests not representing
234 // leaks, just async work items waiting to be processed.
235 //
236 // Rather than somehow wait for this async queue to drain before running
237 // the leak detector, they're all cancelled to prevent flaky leaks being
238 // reported.
239 m_requestQueue.clear();
240 }
241
229 void SpellCheckRequester::invokeRequest(PassRefPtrWillBeRawPtr<SpellCheckRequest > request) 242 void SpellCheckRequester::invokeRequest(PassRefPtrWillBeRawPtr<SpellCheckRequest > request)
230 { 243 {
231 ASSERT(!m_processingRequest); 244 ASSERT(!m_processingRequest);
232 m_processingRequest = request; 245 m_processingRequest = request;
233 client().requestCheckingOfString(m_processingRequest); 246 client().requestCheckingOfString(m_processingRequest);
234 } 247 }
235 248
236 void SpellCheckRequester::clearProcessingRequest() 249 void SpellCheckRequester::clearProcessingRequest()
237 { 250 {
238 if (!m_processingRequest) 251 if (!m_processingRequest)
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 } 324 }
312 325
313 DEFINE_TRACE(SpellCheckRequester) 326 DEFINE_TRACE(SpellCheckRequester)
314 { 327 {
315 visitor->trace(m_frame); 328 visitor->trace(m_frame);
316 visitor->trace(m_processingRequest); 329 visitor->trace(m_processingRequest);
317 visitor->trace(m_requestQueue); 330 visitor->trace(m_requestQueue);
318 } 331 }
319 332
320 } // namespace blink 333 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698