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

Unified Diff: sql/connection.h

Issue 17058004: [sql] Static helper to delete database and all associated files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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') | no next file with comments »
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 049d7cf5b4e2f9715ffc4b7f67dd2e89dc367bff..8525b17ee0178835e1735b852d5dc8a19c84cd5a 100644
--- a/sql/connection.h
+++ b/sql/connection.h
@@ -265,6 +265,18 @@ class SQL_EXPORT Connection {
// cases.
bool RazeAndClose();
+ // 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
+ // database, this could cause odd results or corruption (for
+ // instance if a hot journal is deleted but the associated database
+ // is not).
+ //
+ // Returns true if the database file and associated journals no
+ // longer exist, false otherwise. If the database has never
+ // existed, this will return true.
+ static bool Delete(const base::FilePath& path);
+
// Transactions --------------------------------------------------------------
// Transaction management. We maintain a virtual transaction stack to emulate
« no previous file with comments | « no previous file | sql/connection.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698