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

Unified Diff: components/spellcheck/renderer/spellcheck_provider.cc

Issue 2494123002: Spellcheck : Fix caching in cases where text is deleted. (Closed)
Patch Set: Created 4 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/spellcheck/renderer/spellcheck_provider.cc
diff --git a/components/spellcheck/renderer/spellcheck_provider.cc b/components/spellcheck/renderer/spellcheck_provider.cc
index f52fe596705c94e675d860375170502247e45779..4eb12f196d7359daaa0028dcfdb4cef7d646e14d 100644
--- a/components/spellcheck/renderer/spellcheck_provider.cc
+++ b/components/spellcheck/renderer/spellcheck_provider.cc
@@ -329,17 +329,15 @@ bool SpellCheckProvider::SatisfyRequestFromCache(
if (start <= text_length && end <= text_length)
++result_size;
}
- if (result_size > 0) {
- blink::WebVector<blink::WebTextCheckingResult> results(result_size);
- for (size_t i = 0; i < result_size; ++i) {
- results[i].decoration = last_results_[i].decoration;
- results[i].location = last_results_[i].location;
- results[i].length = last_results_[i].length;
- results[i].replacement = last_results_[i].replacement;
- }
- completion->didFinishCheckingText(results);
- return true;
+ blink::WebVector<blink::WebTextCheckingResult> results(result_size);
groby-ooo-7-16 2016/11/15 19:36:57 So, I might be misreading this, but it looks to me
timvolodine 2016/11/17 20:53:15 Yes much more compact indeed. Done.
+ for (size_t i = 0; i < result_size; ++i) {
+ results[i].decoration = last_results_[i].decoration;
+ results[i].location = last_results_[i].location;
+ results[i].length = last_results_[i].length;
+ results[i].replacement = last_results_[i].replacement;
}
+ completion->didFinishCheckingText(results);
+ return true;
groby-ooo-7-16 2016/11/15 19:36:57 I don't think this works as intended. SatisfyReque
timvolodine 2016/11/17 20:53:15 So currently a substring without misspellings will
}
return false;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698