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

Unified Diff: chrome/browser/autocomplete_history_manager.cc

Issue 6211002: Don't create a WebDataService in AutoFillManagerTest tests, since that object... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 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 | « no previous file | chrome/browser/autofill/autofill_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autocomplete_history_manager.cc
===================================================================
--- chrome/browser/autocomplete_history_manager.cc (revision 70916)
+++ chrome/browser/autocomplete_history_manager.cc (working copy)
@@ -127,13 +127,14 @@
values.push_back(*iter);
}
- if (!values.empty() && web_data_service_)
+ if (!values.empty() && web_data_service_.get())
web_data_service_->AddFormFields(values);
}
void AutocompleteHistoryManager::OnRemoveAutocompleteEntry(
const string16& name, const string16& value) {
- web_data_service_->RemoveFormValueForElementName(name, value);
+ if (web_data_service_.get())
+ web_data_service_->RemoveFormValueForElementName(name, value);
}
void AutocompleteHistoryManager::OnGetAutocompleteSuggestions(
@@ -156,8 +157,10 @@
return;
}
- pending_query_handle_ = web_data_service_->GetFormValuesForElementName(
- name, prefix, kMaxAutocompleteMenuItems, this);
+ if (web_data_service_.get()) {
+ pending_query_handle_ = web_data_service_->GetFormValuesForElementName(
+ name, prefix, kMaxAutocompleteMenuItems, this);
+ }
}
void AutocompleteHistoryManager::OnWebDataServiceRequestDone(
@@ -192,7 +195,8 @@
void AutocompleteHistoryManager::CancelPendingQuery() {
if (pending_query_handle_) {
SendSuggestions(NULL);
- web_data_service_->CancelRequest(pending_query_handle_);
+ if (web_data_service_.get())
+ web_data_service_->CancelRequest(pending_query_handle_);
pending_query_handle_ = 0;
}
}
« no previous file with comments | « no previous file | chrome/browser/autofill/autofill_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698