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

Unified Diff: sync/api/mock_model_type_store.cc

Issue 1866243002: Convert //sync from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
Index: sync/api/mock_model_type_store.cc
diff --git a/sync/api/mock_model_type_store.cc b/sync/api/mock_model_type_store.cc
index 87d3fe15e4c898f9ba59e6dcc0f3c436a53a7076..41bc9778338132a960aea835a01cc17931e5cf79 100644
--- a/sync/api/mock_model_type_store.cc
+++ b/sync/api/mock_model_type_store.cc
@@ -9,6 +9,7 @@
#include "base/bind.h"
#include "base/location.h"
#include "base/logging.h"
+#include "base/memory/ptr_util.h"
#include "base/single_thread_task_runner.h"
#include "base/thread_task_runner_handle.h"
@@ -25,8 +26,8 @@ void MockModelTypeStore::ReadData(const IdList& id_list,
} else {
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, base::Bind(callback, Result::SUCCESS,
- base::Passed(scoped_ptr<RecordList>()),
- base::Passed(scoped_ptr<IdList>())));
+ base::Passed(std::unique_ptr<RecordList>()),
+ base::Passed(std::unique_ptr<IdList>())));
}
}
@@ -36,7 +37,7 @@ void MockModelTypeStore::ReadAllData(const ReadAllDataCallback& callback) {
} else {
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, base::Bind(callback, Result::SUCCESS,
- base::Passed(scoped_ptr<RecordList>())));
+ base::Passed(std::unique_ptr<RecordList>())));
}
}
@@ -47,17 +48,18 @@ void MockModelTypeStore::ReadAllMetadata(const ReadMetadataCallback& callback) {
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE,
base::Bind(callback, Result::SUCCESS,
- base::Passed(scoped_ptr<RecordList>()), std::string()));
+ base::Passed(std::unique_ptr<RecordList>()), std::string()));
}
}
-scoped_ptr<MockModelTypeStore::WriteBatch>
+std::unique_ptr<MockModelTypeStore::WriteBatch>
MockModelTypeStore::CreateWriteBatch() {
- return make_scoped_ptr(new MockModelTypeStore::WriteBatch());
+ return base::WrapUnique(new MockModelTypeStore::WriteBatch());
}
-void MockModelTypeStore::CommitWriteBatch(scoped_ptr<WriteBatch> write_batch,
- const CallbackWithResult& callback) {
+void MockModelTypeStore::CommitWriteBatch(
+ std::unique_ptr<WriteBatch> write_batch,
+ const CallbackWithResult& callback) {
if (!commit_write_batch_handler_.is_null()) {
commit_write_batch_handler_.Run(std::move(write_batch), callback);
} else {

Powered by Google App Engine
This is Rietveld 408576698