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

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

Issue 8966003: Update webdata files to take advantage of DLOG(FATAL) in (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add header comments for a couple tricky error cases. Created 9 years 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/autofill_table_unittest.cc ('k') | chrome/browser/webdata/logins_table.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/webdata/keyword_table.cc
diff --git a/chrome/browser/webdata/keyword_table.cc b/chrome/browser/webdata/keyword_table.cc
index 6ecca88a615bbd93d88cdc31f957c06fbbed49c1..6bec844c0033a6f33d8329cc3206f6e08aca2c55 100644
--- a/chrome/browser/webdata/keyword_table.cc
+++ b/chrome/browser/webdata/keyword_table.cc
@@ -148,14 +148,10 @@ bool KeywordTable::AddKeyword(const TemplateURL& url) {
"autogenerate_keyword, logo_id, created_by_policy, instant_url, "
"last_modified, sync_guid, id) VALUES "
"(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"));
- if (!s) {
- NOTREACHED() << "Statement prepare failed";
- return false;
- }
BindURLToStatement(url, &s);
s.BindInt64(kUrlIdPosition, url.id());
+
if (!s.Run()) {
- NOTREACHED();
return false;
}
return UpdateBackupSignature();
@@ -163,12 +159,10 @@ bool KeywordTable::AddKeyword(const TemplateURL& url) {
bool KeywordTable::RemoveKeyword(TemplateURLID id) {
DCHECK(id);
- sql::Statement s(db_->GetUniqueStatement("DELETE FROM keywords WHERE id=?"));
- if (!s) {
- NOTREACHED() << "Statement prepare failed";
- return false;
- }
+ sql::Statement s(
+ db_->GetUniqueStatement("DELETE FROM keywords WHERE id = ?"));
s.BindInt64(0, id);
+
return s.Run() && UpdateBackupSignature();
}
@@ -180,10 +174,7 @@ bool KeywordTable::GetKeywords(std::vector<TemplateURL*>* urls) {
"suggest_url, prepopulate_id, autogenerate_keyword, logo_id, "
"created_by_policy, instant_url, last_modified, sync_guid "
"FROM keywords ORDER BY id ASC"));
- if (!s) {
- NOTREACHED() << "Statement prepare failed";
- return false;
- }
+
while (s.Step()) {
TemplateURL* template_url = new TemplateURL();
GetURLFromStatement(s, template_url);
@@ -203,12 +194,9 @@ bool KeywordTable::UpdateKeyword(const TemplateURL& url) {
"suggest_url=?, prepopulate_id=?, autogenerate_keyword=?, "
"logo_id=?, created_by_policy=?, instant_url=?, last_modified=?, "
"sync_guid=? WHERE id=?"));
- if (!s) {
- NOTREACHED() << "Statement prepare failed";
- return false;
- }
BindURLToStatement(url, &s);
s.BindInt64(kUrlIdPosition, url.id());
+
return s.Run() && UpdateBackupSignature();
}
« no previous file with comments | « chrome/browser/webdata/autofill_table_unittest.cc ('k') | chrome/browser/webdata/logins_table.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698