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 dismounting and causing sql failures. |
| 180 // See http://crbug.com/68783. |
| 181 if (!result) { |
| 182 SendSuggestions(NULL); |
| 183 return; |
| 184 } |
| 185 |
178 DCHECK(result->GetType() == AUTOFILL_VALUE_RESULT); | 186 DCHECK(result->GetType() == AUTOFILL_VALUE_RESULT); |
179 const WDResult<std::vector<string16> >* autofill_result = | 187 const WDResult<std::vector<string16> >* autofill_result = |
180 static_cast<const WDResult<std::vector<string16> >*>(result); | 188 static_cast<const WDResult<std::vector<string16> >*>(result); |
181 std::vector<string16> suggestions = autofill_result->GetValue(); | 189 std::vector<string16> suggestions = autofill_result->GetValue(); |
182 SendSuggestions(&suggestions); | 190 SendSuggestions(&suggestions); |
183 } | 191 } |
184 | 192 |
185 AutocompleteHistoryManager::AutocompleteHistoryManager( | 193 AutocompleteHistoryManager::AutocompleteHistoryManager( |
186 Profile* profile, WebDataService* wds) : tab_contents_(NULL), | 194 Profile* profile, WebDataService* wds) : tab_contents_(NULL), |
187 profile_(profile), | 195 profile_(profile), |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 autofill_icons_, | 241 autofill_icons_, |
234 autofill_unique_ids_)); | 242 autofill_unique_ids_)); |
235 } | 243 } |
236 | 244 |
237 query_id_ = 0; | 245 query_id_ = 0; |
238 autofill_values_.clear(); | 246 autofill_values_.clear(); |
239 autofill_labels_.clear(); | 247 autofill_labels_.clear(); |
240 autofill_icons_.clear(); | 248 autofill_icons_.clear(); |
241 autofill_unique_ids_.clear(); | 249 autofill_unique_ids_.clear(); |
242 } | 250 } |
OLD | NEW |