OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/autocomplete_history_manager.h" | 5 #include "chrome/browser/autocomplete_history_manager.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/string16.h" | 9 #include "base/string16.h" |
10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
168 const WDTypedResult* result) { | 168 const WDTypedResult* result) { |
169 DCHECK(pending_query_handle_); | 169 DCHECK(pending_query_handle_); |
170 pending_query_handle_ = 0; | 170 pending_query_handle_ = 0; |
171 | 171 |
172 if (!*autofill_enabled_) { | 172 if (!*autofill_enabled_) { |
173 SendSuggestions(NULL); | 173 SendSuggestions(NULL); |
174 return; | 174 return; |
175 } | 175 } |
176 | 176 |
177 DCHECK(result); | 177 DCHECK(result); |
178 // Returning early here if |result| is NULL. We've seen this happen on | |
179 // Linux due to NFS dismouting and causing sql failures. See crbug.com/68783. | |
Ilya Sherman
2011/01/21 01:58:09
nit: http://crbug.com/68783
willchan no longer on Chromium
2011/01/21 02:01:27
NFS dismounting.
dhollowa
2011/01/21 02:05:41
Done. But there's a mix of the two forms in the c
dhollowa
2011/01/21 02:05:41
Done.
| |
180 if (!result) { | |
181 SendSuggestions(NULL); | |
182 return; | |
183 } | |
184 | |
178 DCHECK(result->GetType() == AUTOFILL_VALUE_RESULT); | 185 DCHECK(result->GetType() == AUTOFILL_VALUE_RESULT); |
179 const WDResult<std::vector<string16> >* autofill_result = | 186 const WDResult<std::vector<string16> >* autofill_result = |
180 static_cast<const WDResult<std::vector<string16> >*>(result); | 187 static_cast<const WDResult<std::vector<string16> >*>(result); |
181 std::vector<string16> suggestions = autofill_result->GetValue(); | 188 std::vector<string16> suggestions = autofill_result->GetValue(); |
182 SendSuggestions(&suggestions); | 189 SendSuggestions(&suggestions); |
183 } | 190 } |
184 | 191 |
185 AutocompleteHistoryManager::AutocompleteHistoryManager( | 192 AutocompleteHistoryManager::AutocompleteHistoryManager( |
186 Profile* profile, WebDataService* wds) : tab_contents_(NULL), | 193 Profile* profile, WebDataService* wds) : tab_contents_(NULL), |
187 profile_(profile), | 194 profile_(profile), |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
233 autofill_icons_, | 240 autofill_icons_, |
234 autofill_unique_ids_)); | 241 autofill_unique_ids_)); |
235 } | 242 } |
236 | 243 |
237 query_id_ = 0; | 244 query_id_ = 0; |
238 autofill_values_.clear(); | 245 autofill_values_.clear(); |
239 autofill_labels_.clear(); | 246 autofill_labels_.clear(); |
240 autofill_icons_.clear(); | 247 autofill_icons_.clear(); |
241 autofill_unique_ids_.clear(); | 248 autofill_unique_ids_.clear(); |
242 } | 249 } |
OLD | NEW |