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

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

Issue 2747373004: Migrate WTF::Deque::remove() to ::erase() (Closed)
Patch Set: Created 3 years, 9 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 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 // Spellcheck requests for chunks of text in the same element should not 218 // Spellcheck requests for chunks of text in the same element should not
219 // overwrite each other. 219 // overwrite each other.
220 if (!continuation) { 220 if (!continuation) {
221 RequestQueue::const_iterator sameElementRequest = 221 RequestQueue::const_iterator sameElementRequest =
222 std::find_if(m_requestQueue.begin(), m_requestQueue.end(), 222 std::find_if(m_requestQueue.begin(), m_requestQueue.end(),
223 [request](const SpellCheckRequest* queuedRequest) -> bool { 223 [request](const SpellCheckRequest* queuedRequest) -> bool {
224 return request->rootEditableElement() == 224 return request->rootEditableElement() ==
225 queuedRequest->rootEditableElement(); 225 queuedRequest->rootEditableElement();
226 }); 226 });
227 if (sameElementRequest != m_requestQueue.end()) 227 if (sameElementRequest != m_requestQueue.end())
228 m_requestQueue.remove(sameElementRequest); 228 m_requestQueue.erase(sameElementRequest);
229 } 229 }
230 230
231 m_requestQueue.push_back(request); 231 m_requestQueue.push_back(request);
232 } 232 }
233 233
234 void SpellCheckRequester::didCheck(int sequence, 234 void SpellCheckRequester::didCheck(int sequence,
235 const Vector<TextCheckingResult>& results) { 235 const Vector<TextCheckingResult>& results) {
236 DCHECK(m_processingRequest); 236 DCHECK(m_processingRequest);
237 DCHECK_EQ(m_processingRequest->data().sequence(), sequence); 237 DCHECK_EQ(m_processingRequest->data().sequence(), sequence);
238 if (m_processingRequest->data().sequence() != sequence) { 238 if (m_processingRequest->data().sequence() != sequence) {
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 didCheck(sequence, results); 276 didCheck(sequence, results);
277 } 277 }
278 278
279 DEFINE_TRACE(SpellCheckRequester) { 279 DEFINE_TRACE(SpellCheckRequester) {
280 visitor->trace(m_frame); 280 visitor->trace(m_frame);
281 visitor->trace(m_processingRequest); 281 visitor->trace(m_processingRequest);
282 visitor->trace(m_requestQueue); 282 visitor->trace(m_requestQueue);
283 } 283 }
284 284
285 } // namespace blink 285 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/commands/UndoStack.cpp ('k') | third_party/WebKit/Source/core/fileapi/FileReader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698