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

Unified Diff: chrome/browser/webdata/web_data_service.cc

Issue 9982018: Move most TemplateURL data members to a new struct, TemplateURLData. This allows us to eliminate t… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 8 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 | « chrome/browser/webdata/web_data_service.h ('k') | chrome/browser/webdata/web_data_service_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/webdata/web_data_service.cc
===================================================================
--- chrome/browser/webdata/web_data_service.cc (revision 130759)
+++ chrome/browser/webdata/web_data_service.cc (working copy)
@@ -72,7 +72,9 @@
WDKeywordsResult::WDKeywordsResult()
: default_search_provider_id(0),
- builtin_keyword_version(0) {
+ builtin_keyword_version(0),
+ backup_valid(false),
+ did_default_search_provider_change(false) {
}
WDKeywordsResult::~WDKeywordsResult() {}
@@ -152,14 +154,14 @@
// the TemplateURL for use on another keyword.
url.EnsureKeyword();
GenericRequest<TemplateURL>* request =
- new GenericRequest<TemplateURL>(this, GetNextRequestHandle(), NULL, url);
+ new GenericRequest<TemplateURL>(this, GetNextRequestHandle(), NULL, url);
RegisterRequest(request);
ScheduleTask(FROM_HERE, Bind(&WebDataService::AddKeywordImpl, this, request));
}
-void WebDataService::RemoveKeyword(const TemplateURL& url) {
- GenericRequest<TemplateURLID>* request = new GenericRequest<TemplateURLID>(
- this, GetNextRequestHandle(), NULL, url.id());
+void WebDataService::RemoveKeyword(TemplateURLID id) {
+ GenericRequest<TemplateURLID>* request =
+ new GenericRequest<TemplateURLID>(this, GetNextRequestHandle(), NULL, id);
RegisterRequest(request);
ScheduleTask(FROM_HERE,
Bind(&WebDataService::RemoveKeywordImpl, this, request));
@@ -819,8 +821,7 @@
request->RequestComplete();
}
-void WebDataService::RemoveKeywordImpl(
- GenericRequest<TemplateURLID>* request) {
+void WebDataService::RemoveKeywordImpl(GenericRequest<TemplateURLID>* request) {
InitializeDatabaseIfNecessary();
if (db_ && !request->IsCancelled(NULL)) {
DCHECK(request->arg());
@@ -853,10 +854,9 @@
db_->GetKeywordTable()->GetBuiltinKeywordVersion();
result.did_default_search_provider_change =
db_->GetKeywordTable()->DidDefaultSearchProviderChange();
- result.default_search_provider_backup =
- result.did_default_search_provider_change ?
- db_->GetKeywordTable()->GetDefaultSearchProviderBackup() :
- NULL;
+ result.backup_valid = result.did_default_search_provider_change &&
+ db_->GetKeywordTable()->GetDefaultSearchProviderBackup(
+ &result.default_search_provider_backup);
request->SetResult(
new WDResult<WDKeywordsResult>(KEYWORDS_RESULT, result));
}
« no previous file with comments | « chrome/browser/webdata/web_data_service.h ('k') | chrome/browser/webdata/web_data_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698