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

Unified Diff: app/sql/transaction.h

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/statement_unittest.cc ('k') | app/sql/transaction.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: app/sql/transaction.h
diff --git a/app/sql/transaction.h b/app/sql/transaction.h
deleted file mode 100644
index c65ca8d6610118eab32ede5586148dc73ef9423d..0000000000000000000000000000000000000000
--- a/app/sql/transaction.h
+++ /dev/null
@@ -1,57 +0,0 @@
-// Copyright (c) 2009 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.
-
-#ifndef APP_SQL_TRANSACTION_H_
-#define APP_SQL_TRANSACTION_H_
-#pragma once
-
-#include "base/basictypes.h"
-
-namespace sql {
-
-class Connection;
-
-class Transaction {
- public:
- // Creates the scoped transaction object. You MUST call Begin() to begin the
- // transaction. If you have begun a transaction and not committed it, the
- // constructor will roll back the transaction. If you want to commit, you
- // need to manually call Commit before this goes out of scope.
- explicit Transaction(Connection* connection);
- ~Transaction();
-
- // Returns true when there is a transaction that has been successfully begun.
- bool is_open() const { return is_open_; }
-
- // Begins the transaction. This uses the default sqlite "deferred" transaction
- // type, which means that the DB lock is lazily acquired the next time the
- // database is accessed, not in the begin transaction command.
- //
- // Returns false on failure. Note that if this fails, you shouldn't do
- // anything you expect to be actually transactional, because it won't be!
- bool Begin();
-
- // Rolls back the transaction. This will happen automatically if you do
- // nothing when the transaction goes out of scope.
- void Rollback();
-
- // Commits the transaction, returning true on success. This will return
- // false if sqlite could not commit it, or if another transaction in the
- // same outermost transaction has been rolled back (which necessitates a
- // rollback of all transactions in that outermost one).
- bool Commit();
-
- private:
- Connection* connection_;
-
- // True when the transaction is open, false when it's already been committed
- // or rolled back.
- bool is_open_;
-
- DISALLOW_COPY_AND_ASSIGN(Transaction);
-};
-
-} // namespace sql
-
-#endif // APP_SQL_TRANSACTION_H_
« no previous file with comments | « app/sql/statement_unittest.cc ('k') | app/sql/transaction.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698