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

Side by Side Diff: Source/core/editing/spellcheck/SpellCheckRequester.cpp

Issue 1329253002: WIP: prefer using EphemeralRange for SpellChecker. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: introduce Range::dispose() 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 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 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 if (m_processingRequest->data().sequence() != sequence) { 244 if (m_processingRequest->data().sequence() != sequence) {
245 m_requestQueue.clear(); 245 m_requestQueue.clear();
246 return; 246 return;
247 } 247 }
248 248
249 frame().spellChecker().markAndReplaceFor(m_processingRequest, results); 249 frame().spellChecker().markAndReplaceFor(m_processingRequest, results);
250 250
251 if (m_lastProcessedSequence < sequence) 251 if (m_lastProcessedSequence < sequence)
252 m_lastProcessedSequence = sequence; 252 m_lastProcessedSequence = sequence;
253 253
254 // This assumes that m_processingRequest's Ranges aren't shared.
255 if (m_processingRequest->checkingRange())
256 m_processingRequest->checkingRange()->dispose();
257 if (m_processingRequest->paragraphRange())
258 m_processingRequest->paragraphRange()->dispose();
259
254 m_processingRequest.clear(); 260 m_processingRequest.clear();
255 if (!m_requestQueue.isEmpty()) 261 if (!m_requestQueue.isEmpty())
256 m_timerToProcessQueuedRequest.startOneShot(0, FROM_HERE); 262 m_timerToProcessQueuedRequest.startOneShot(0, FROM_HERE);
257 } 263 }
258 264
259 void SpellCheckRequester::didCheckSucceed(int sequence, const Vector<TextCheckin gResult>& results) 265 void SpellCheckRequester::didCheckSucceed(int sequence, const Vector<TextCheckin gResult>& results)
260 { 266 {
261 TextCheckingRequestData requestData = m_processingRequest->data(); 267 TextCheckingRequestData requestData = m_processingRequest->data();
262 if (requestData.sequence() == sequence) { 268 if (requestData.sequence() == sequence) {
263 DocumentMarker::MarkerTypes markers = DocumentMarker::SpellCheckClientMa rkers(); 269 DocumentMarker::MarkerTypes markers = DocumentMarker::SpellCheckClientMa rkers();
(...skipping 14 matching lines...) Expand all
278 } 284 }
279 285
280 DEFINE_TRACE(SpellCheckRequester) 286 DEFINE_TRACE(SpellCheckRequester)
281 { 287 {
282 visitor->trace(m_frame); 288 visitor->trace(m_frame);
283 visitor->trace(m_processingRequest); 289 visitor->trace(m_processingRequest);
284 visitor->trace(m_requestQueue); 290 visitor->trace(m_requestQueue);
285 } 291 }
286 292
287 } // namespace blink 293 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698