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

Unified Diff: chrome/browser/autocomplete/network_action_predictor_database.cc

Issue 9365030: More SQL statement usage regularization. Back-touch some (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix log messages Created 8 years, 10 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
Index: chrome/browser/autocomplete/network_action_predictor_database.cc
diff --git a/chrome/browser/autocomplete/network_action_predictor_database.cc b/chrome/browser/autocomplete/network_action_predictor_database.cc
index fe3ce818146f4a37be4f98c0683ef1d66061dccb..79c284725d24f9953ec040da0a44443a73aba15d 100644
--- a/chrome/browser/autocomplete/network_action_predictor_database.cc
+++ b/chrome/browser/autocomplete/network_action_predictor_database.cc
@@ -57,7 +57,7 @@ void LogDatabaseStats(const FilePath& db_path, sql::Connection* db) {
sql::Statement count_statement(db->GetUniqueStatement(
base::StringPrintf("SELECT count(id) FROM %s",
kNetworkActionPredictorTableName).c_str()));
- if (!count_statement || !count_statement.Step())
+ if (!count_statement.Step())
return;
UMA_HISTOGRAM_COUNTS("NetworkActionPredictor.DatabaseRowCount",
count_statement.ColumnInt(0));
@@ -117,8 +117,6 @@ void NetworkActionPredictorDatabase::GetRow(const Row::Id& id, Row* row) {
base::StringPrintf(
"SELECT * FROM %s WHERE id=?",
kNetworkActionPredictorTableName).c_str()));
- DCHECK(statement);
-
statement.BindString(0, id);
bool success = StepAndInitializeRow(&statement, row);
@@ -138,7 +136,6 @@ void NetworkActionPredictorDatabase::GetAllRows(
sql::Statement statement(db_.GetCachedStatement(SQL_FROM_HERE,
base::StringPrintf(
"SELECT * FROM %s", kNetworkActionPredictorTableName).c_str()));
- DCHECK(statement);
Row row;
while (StepAndInitializeRow(&statement, &row))
@@ -157,8 +154,6 @@ void NetworkActionPredictorDatabase::AddRow(
"INSERT INTO %s "
"(id, user_text, url, number_of_hits, number_of_misses) "
"VALUES (?,?,?,?,?)", kNetworkActionPredictorTableName).c_str()));
- DCHECK(statement);
-
BindRowToStatement(row, &statement);
bool success = statement.Run();
@@ -178,8 +173,6 @@ void NetworkActionPredictorDatabase::UpdateRow(
"UPDATE %s "
"SET id=?, user_text=?, url=?, number_of_hits=?, number_of_misses=? "
"WHERE id=?1", kNetworkActionPredictorTableName).c_str()));
- DCHECK(statement);
-
BindRowToStatement(row, &statement);
statement.Run();
@@ -205,7 +198,6 @@ void NetworkActionPredictorDatabase::DeleteRows(
sql::Statement statement(db_.GetUniqueStatement(base::StringPrintf(
"DELETE FROM %s WHERE id=?",
kNetworkActionPredictorTableName).c_str()));
- DCHECK(statement);
db_.BeginTransaction();
for (std::vector<Row::Id>::const_iterator it = id_list.begin();
@@ -226,7 +218,6 @@ void NetworkActionPredictorDatabase::DeleteAllRows() {
sql::Statement statement(db_.GetCachedStatement(SQL_FROM_HERE,
base::StringPrintf("DELETE FROM %s",
kNetworkActionPredictorTableName).c_str()));
- DCHECK(statement);
statement.Run();
}
« no previous file with comments | « no previous file | chrome/browser/diagnostics/sqlite_diagnostics.cc » ('j') | chrome/browser/net/sqlite_origin_bound_cert_store.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698