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

Unified Diff: sql/transaction.cc

Issue 217613002: Misc. cleanup found while mucking with search engines code: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 6 years, 9 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
« chrome/browser/webdata/keyword_table.cc ('K') | « sql/connection.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sql/transaction.cc
===================================================================
--- sql/transaction.cc (revision 259649)
+++ sql/transaction.cc (working copy)
@@ -20,30 +20,21 @@
}
bool Transaction::Begin() {
- if (is_open_) {
- NOTREACHED() << "Beginning a transaction twice!";
- return false;
- }
+ DCHECK(!is_open_) << "Beginning a transaction twice!";
Scott Hess - ex-Googler 2014/03/31 18:09:08 These changes may cause actual incorrect changes i
Peter Kasting 2014/03/31 19:53:56 We have to make _some_ change, because the old cod
is_open_ = connection_->BeginTransaction();
return is_open_;
}
void Transaction::Rollback() {
- if (!is_open_) {
- NOTREACHED() << "Attempting to roll back a nonexistent transaction. "
- << "Did you remember to call Begin() and check its return?";
- return;
- }
+ DCHECK(is_open_) << "Attempting to roll back a nonexistent transaction. "
+ << "Did you remember to call Begin() and check its return?";
is_open_ = false;
connection_->RollbackTransaction();
}
bool Transaction::Commit() {
- if (!is_open_) {
- NOTREACHED() << "Attempting to commit a nonexistent transaction. "
- << "Did you remember to call Begin() and check its return?";
- return false;
- }
+ DCHECK(is_open_) << "Attempting to commit a nonexistent transaction. "
+ << "Did you remember to call Begin() and check its return?";
is_open_ = false;
return connection_->CommitTransaction();
}
« chrome/browser/webdata/keyword_table.cc ('K') | « sql/connection.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698