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

Unified Diff: chrome/browser/history/history_database.cc

Issue 225020: Coverity: Initialize statement_cache_ in the constructor.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 3 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/history/history_database.cc
===================================================================
--- chrome/browser/history/history_database.cc (revision 27013)
+++ chrome/browser/history/history_database.cc (working copy)
@@ -6,6 +6,7 @@
#include <algorithm>
#include <set>
+#include <string>
#include "base/file_util.h"
#include "base/histogram.h"
@@ -54,6 +55,7 @@
HistoryDatabase::HistoryDatabase()
: transaction_nesting_(0),
db_(NULL),
+ statement_cache_(NULL),
needs_version_17_migration_(false) {
}
@@ -137,7 +139,7 @@
void HistoryDatabase::CommitTransaction() {
DCHECK(db_);
- DCHECK(transaction_nesting_ > 0) << "Committing too many transactions";
+ DCHECK_GT(transaction_nesting_, 0) << "Committing too many transactions";
transaction_nesting_--;
if (transaction_nesting_ == 0) {
int rv = sqlite3_exec(db_, "COMMIT", NULL, NULL, NULL);
@@ -169,7 +171,7 @@
}
void HistoryDatabase::Vacuum() {
- DCHECK(transaction_nesting_ == 0) <<
+ DCHECK_EQ(0, transaction_nesting_) <<
"Can not have a transaction when vacuuming.";
sqlite3_exec(db_, "VACUUM", NULL, NULL, NULL);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698