Chromium Code Reviews| Index: components/browsing_data/core/counters/autofill_counter.cc |
| diff --git a/components/browsing_data/core/counters/autofill_counter.cc b/components/browsing_data/core/counters/autofill_counter.cc |
| index a852db41549344abd96c50f54d186ca9a06272d9..380028e65957185c2f5d95931c88ce574e9f8b07 100644 |
| --- a/components/browsing_data/core/counters/autofill_counter.cc |
| +++ b/components/browsing_data/core/counters/autofill_counter.cc |
| @@ -81,7 +81,18 @@ void AutofillCounter::OnWebDataServiceRequestDone( |
| WebDataServiceBase::Handle handle, |
| std::unique_ptr<WDTypedResult> result) { |
| DCHECK(thread_checker_.CalledOnValidThread()); |
| + |
| if (!result) { |
| + // CancelAllRequests will cancel all queries that are active; the query that |
| + // just failed is complete and cannot be canceled so zero it out. |
| + if (handle == suggestions_query_) { |
| + suggestions_query_ = 0; |
| + } else if (handle == credit_cards_query_) { |
| + credit_cards_query_ = 0; |
| + } else if (handle == addresses_query_) { |
| + addresses_query_ = 0; |
| + } |
|
Bernhard Bauer
2016/12/12 14:56:26
Maybe add an else { NOTREACHED(); } just for compl
Avi (use Gerrit)
2016/12/12 15:16:48
Done.
|
| + |
| CancelAllRequests(); |
| return; |
| } |