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

Unified Diff: sql/recovery.h

Issue 1851913002: Convert //sql to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: IWYU fixup in precache_url_table_unittest.cc Created 4 years, 8 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 | « sql/connection_unittest.cc ('k') | sql/recovery.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sql/recovery.h
diff --git a/sql/recovery.h b/sql/recovery.h
index af99108192908593db1ef4844086324609f35a2b..8efd71877318b04f1df5486f135257038717918d 100644
--- a/sql/recovery.h
+++ b/sql/recovery.h
@@ -7,6 +7,8 @@
#include <stddef.h>
+#include <memory>
+
#include "base/macros.h"
#include "sql/connection.h"
@@ -25,7 +27,7 @@ namespace sql {
// not accidentally disrupt the restored data.
//
// {
-// scoped_ptr<sql::Recovery> r =
+// std::unique_ptr<sql::Recovery> r =
// sql::Recovery::Begin(orig_db, orig_db_path);
// if (r) {
// // Create the schema to recover to. On failure, clear the
@@ -80,9 +82,9 @@ class SQL_EXPORT Recovery {
// TODO(shess): Later versions of SQLite allow extracting the path
// from the connection.
// TODO(shess): Allow specifying the connection point?
- static scoped_ptr<Recovery> Begin(
- Connection* connection,
- const base::FilePath& db_path) WARN_UNUSED_RESULT;
+ static std::unique_ptr<Recovery> Begin(Connection* connection,
+ const base::FilePath& db_path)
+ WARN_UNUSED_RESULT;
// Mark recovery completed by replicating the recovery database over
// the original database, then closing the recovery database. The
@@ -95,11 +97,11 @@ class SQL_EXPORT Recovery {
// TODO(shess): At this time, this function can fail while leaving
// the original database intact. Figure out which failure cases
// should go to RazeAndClose() instead.
- static bool Recovered(scoped_ptr<Recovery> r) WARN_UNUSED_RESULT;
+ static bool Recovered(std::unique_ptr<Recovery> r) WARN_UNUSED_RESULT;
// Indicate that the database is unrecoverable. The original
// database is razed, and the handle poisoned.
- static void Unrecoverable(scoped_ptr<Recovery> r);
+ static void Unrecoverable(std::unique_ptr<Recovery> r);
// When initially developing recovery code, sometimes the possible
// database states are not well-understood without further
@@ -107,7 +109,7 @@ class SQL_EXPORT Recovery {
// database.
// NOTE(shess): Only call this when adding recovery support. In the
// steady state, all databases should progress to recovered or razed.
- static void Rollback(scoped_ptr<Recovery> r);
+ static void Rollback(std::unique_ptr<Recovery> r);
// Handle to the temporary recovery database.
sql::Connection* db() { return &recover_db_; }
« no previous file with comments | « sql/connection_unittest.cc ('k') | sql/recovery.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698