Chromium Code Reviews| 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 112ad5a083ab7695e41038857ee311e71b36518e..f9bfd5b568b811db11c0003888fd14fbf940727c 100644 |
| --- a/third_party/WebKit/Source/core/editing/spellcheck/SpellCheckRequester.cpp |
| +++ b/third_party/WebKit/Source/core/editing/spellcheck/SpellCheckRequester.cpp |
| @@ -33,6 +33,7 @@ |
| #include "core/editing/spellcheck/SpellChecker.h" |
| #include "core/frame/LocalFrame.h" |
| #include "core/frame/Settings.h" |
| +#include "core/html/TextControlElement.h" |
| #include "platform/text/TextCheckerClient.h" |
| namespace blink { |
| @@ -226,12 +227,13 @@ void SpellCheckRequester::enqueueRequest(SpellCheckRequest* request) { |
| // Spellcheck requests for chunks of text in the same element should not |
| // overwrite each other. |
| if (!continuation) { |
| - for (auto& requestQueue : m_requestQueue) { |
| - if (request->rootEditableElement() != requestQueue->rootEditableElement()) |
| + for (RequestQueue::const_iterator iter = m_requestQueue.begin(); |
|
yosin_UTC9
2017/01/17 08:20:12
Can we use std::find_if()?
Xiaocheng
2017/01/17 08:48:18
Yes.Done.
|
| + iter != m_requestQueue.end(); ++iter) { |
| + if (request->rootEditableElement() != (*iter)->rootEditableElement()) |
| continue; |
| - requestQueue = request; |
| - return; |
| + m_requestQueue.remove(iter); |
| + break; |
| } |
| } |
| @@ -249,8 +251,8 @@ void SpellCheckRequester::didCheck(int sequence, |
| frame().spellChecker().markAndReplaceFor(m_processingRequest, results); |
| - if (m_lastProcessedSequence < sequence) |
| - m_lastProcessedSequence = sequence; |
| + DCHECK_LT(m_lastProcessedSequence, sequence); |
| + m_lastProcessedSequence = sequence; |
| clearProcessingRequest(); |
| if (!m_requestQueue.isEmpty()) |