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

Unified Diff: sql/recovery.cc

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/recovery.h ('k') | sql/recovery_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sql/recovery.cc
diff --git a/sql/recovery.cc b/sql/recovery.cc
index 7b9ca9f6fee65724a310e1f34620b97faf60bc7b..92c7f875e152f9d234f1d00ab6c4b23f6376b151 100644
--- a/sql/recovery.cc
+++ b/sql/recovery.cc
@@ -102,9 +102,8 @@ bool Recovery::FullRecoverySupported() {
}
// static
-scoped_ptr<Recovery> Recovery::Begin(
- Connection* connection,
- const base::FilePath& db_path) {
+std::unique_ptr<Recovery> Recovery::Begin(Connection* connection,
+ const base::FilePath& db_path) {
// Recovery is likely to be used in error handling. Since recovery changes
// the state of the handle, protect against multiple layers attempting the
// same recovery.
@@ -112,32 +111,32 @@ scoped_ptr<Recovery> Recovery::Begin(
// Warn about API mis-use.
DLOG_IF(FATAL, !connection->poisoned_)
<< "Illegal to recover with closed database";
- return scoped_ptr<Recovery>();
+ return std::unique_ptr<Recovery>();
}
- scoped_ptr<Recovery> r(new Recovery(connection));
+ std::unique_ptr<Recovery> r(new Recovery(connection));
if (!r->Init(db_path)) {
// TODO(shess): Should Init() failure result in Raze()?
r->Shutdown(POISON);
- return scoped_ptr<Recovery>();
+ return std::unique_ptr<Recovery>();
}
return r;
}
// static
-bool Recovery::Recovered(scoped_ptr<Recovery> r) {
+bool Recovery::Recovered(std::unique_ptr<Recovery> r) {
return r->Backup();
}
// static
-void Recovery::Unrecoverable(scoped_ptr<Recovery> r) {
+void Recovery::Unrecoverable(std::unique_ptr<Recovery> r) {
CHECK(r->db_);
// ~Recovery() will RAZE_AND_POISON.
}
// static
-void Recovery::Rollback(scoped_ptr<Recovery> r) {
+void Recovery::Rollback(std::unique_ptr<Recovery> r) {
// TODO(shess): HISTOGRAM to track? Or just have people crash out?
// Crash and dump?
r->Shutdown(POISON);
« no previous file with comments | « sql/recovery.h ('k') | sql/recovery_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698