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

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

Issue 2635173002: Ensure same invocation order as creation order for SpellCheckRequests (Closed)
Patch Set: Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/editing/spelling/spellcheck-queue.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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())
« no previous file with comments | « third_party/WebKit/LayoutTests/editing/spelling/spellcheck-queue.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698