| OLD | NEW |
| 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 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 { | 222 { |
| 223 m_timerToProcessQueuedRequest.stop(); | 223 m_timerToProcessQueuedRequest.stop(); |
| 224 // Empty the queue of pending requests to prevent it being a leak source. | 224 // Empty the queue of pending requests to prevent it being a leak source. |
| 225 // Pending spell checker requests are cancellable requests not representing | 225 // Pending spell checker requests are cancellable requests not representing |
| 226 // leaks, just async work items waiting to be processed. | 226 // leaks, just async work items waiting to be processed. |
| 227 // | 227 // |
| 228 // Rather than somehow wait for this async queue to drain before running | 228 // Rather than somehow wait for this async queue to drain before running |
| 229 // the leak detector, they're all cancelled to prevent flaky leaks being | 229 // the leak detector, they're all cancelled to prevent flaky leaks being |
| 230 // reported. | 230 // reported. |
| 231 m_requestQueue.clear(); | 231 m_requestQueue.clear(); |
| 232 // WebSpellCheckClient stores a set of WebTextCheckingCompletion objects, |
| 233 // which may store references to already invoked requests. We should clear |
| 234 // these references to prevent them from being a leak source. |
| 235 client().cancelAllPendingRequests(); |
| 232 } | 236 } |
| 233 | 237 |
| 234 void SpellCheckRequester::invokeRequest(SpellCheckRequest* request) | 238 void SpellCheckRequester::invokeRequest(SpellCheckRequest* request) |
| 235 { | 239 { |
| 236 DCHECK(!m_processingRequest); | 240 DCHECK(!m_processingRequest); |
| 237 LOG(INFO) << "SpellCheckRequester::invokeRequest #" << request->data().seque
nce(); | 241 LOG(INFO) << "SpellCheckRequester::invokeRequest #" << request->data().seque
nce(); |
| 238 m_processingRequest = request; | 242 m_processingRequest = request; |
| 239 client().requestCheckingOfString(m_processingRequest); | 243 client().requestCheckingOfString(m_processingRequest); |
| 240 } | 244 } |
| 241 | 245 |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 } | 326 } |
| 323 | 327 |
| 324 DEFINE_TRACE(SpellCheckRequester) | 328 DEFINE_TRACE(SpellCheckRequester) |
| 325 { | 329 { |
| 326 visitor->trace(m_frame); | 330 visitor->trace(m_frame); |
| 327 visitor->trace(m_processingRequest); | 331 visitor->trace(m_processingRequest); |
| 328 visitor->trace(m_requestQueue); | 332 visitor->trace(m_requestQueue); |
| 329 } | 333 } |
| 330 | 334 |
| 331 } // namespace blink | 335 } // namespace blink |
| OLD | NEW |