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

Unified Diff: app/sql/transaction.cc

Issue 7353026: Move app/sql/* files to sql/ directory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 9 years, 5 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 | « app/sql/transaction.h ('k') | app/sql/transaction_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: app/sql/transaction.cc
diff --git a/app/sql/transaction.cc b/app/sql/transaction.cc
deleted file mode 100644
index 10bcfb0a9e3c3682b9b0cd14823065712090363a..0000000000000000000000000000000000000000
--- a/app/sql/transaction.cc
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "app/sql/transaction.h"
-
-#include "app/sql/connection.h"
-#include "base/logging.h"
-
-namespace sql {
-
-Transaction::Transaction(Connection* connection)
- : connection_(connection),
- is_open_(false) {
-}
-
-Transaction::~Transaction() {
- if (is_open_)
- connection_->RollbackTransaction();
-}
-
-bool Transaction::Begin() {
- if (is_open_) {
- NOTREACHED() << "Beginning a transaction twice!";
- return false;
- }
- 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;
- }
- 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;
- }
- is_open_ = false;
- return connection_->CommitTransaction();
-}
-
-} // namespace sql
« no previous file with comments | « app/sql/transaction.h ('k') | app/sql/transaction_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698