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

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: Fix typo 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
Index: chrome/browser/webdata/keyword_table.cc
diff --git a/chrome/browser/webdata/keyword_table.cc b/chrome/browser/webdata/keyword_table.cc
index c7e123e187c9ccbd2b4961d3ef5808b6bd6364fb..4059b6a90a000ebf0c4fb6178251abd7c90e55ca 100644
--- a/chrome/browser/webdata/keyword_table.cc
+++ b/chrome/browser/webdata/keyword_table.cc
@@ -147,14 +147,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();
@@ -162,12 +158,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();
}
@@ -179,10 +173,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);
@@ -202,12 +193,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();
}

Powered by Google App Engine
This is Rietveld 408576698