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

Unified Diff: sql/connection.h

Issue 18180013: Scoped recovery module for sql/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Oops, add recover_unittest.cc Created 7 years, 6 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 | sql/connection.cc » ('j') | sql/connection.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sql/connection.h
diff --git a/sql/connection.h b/sql/connection.h
index a2e8f67f944bd8cde89a05f4345136a855d26944..4f84e36f295994cabdcb0760c386e7b5fcb5d07c 100644
--- a/sql/connection.h
+++ b/sql/connection.h
@@ -28,6 +28,7 @@ class FilePath;
namespace sql {
+class Recovery;
class Statement;
// Uniquely identifies a statement. There are two modes of operation:
@@ -157,6 +158,12 @@ class SQL_EXPORT Connection {
// empty. You can call this or Open.
bool OpenInMemory() WARN_UNUSED_RESULT;
+ // Create a temporary on-disk database. The database will be
+ // deleted after close. This kind of database is similar to
+ // OpenInMemory() for small databases, but can page to disk if the
+ // database becomes large.
+ bool OpenTemporary() WARN_UNUSED_RESULT;
+
// Returns true if the database has been successfully opened.
bool is_open() const { return !!db_; }
@@ -224,6 +231,9 @@ class SQL_EXPORT Connection {
// cases.
bool RazeAndClose();
+ // Like RazeAndClose(), but without the Raze().
+ void CloseAndPoison();
+
// Delete the underlying database files associated with |path|.
// This should be used on a database which has no existing
// connections. If any other connections are open to the same
@@ -251,6 +261,10 @@ class SQL_EXPORT Connection {
void RollbackTransaction();
bool CommitTransaction();
+ // Rollback all outstanding transactions. Use with care, there may
+ // be scoped transactions on the stack.
+ void RollbackAllTransactions();
+
// Returns the current transaction nesting, which will be 0 if there are
// no open transactions.
int transaction_nesting() const { return transaction_nesting_; }
@@ -347,6 +361,9 @@ class SQL_EXPORT Connection {
const char* GetErrorMessage() const;
private:
+ // For recovery module.
+ friend class Recovery;
+
// Allow test-support code to set/reset error ignorer.
friend class ScopedErrorIgnorer;
« no previous file with comments | « no previous file | sql/connection.cc » ('j') | sql/connection.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698