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

Unified Diff: sync/internal_api/sync_context_proxy_impl_unittest.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/internal_api/sync_context_proxy_impl_unittest.cc
diff --git a/sync/internal_api/sync_context_proxy_impl_unittest.cc b/sync/internal_api/sync_context_proxy_impl_unittest.cc
index 6058d67ee4a685c750589aa39d973571656adf8b..fec18e5239930e80abecca126f6c5e539f26031d 100644
--- a/sync/internal_api/sync_context_proxy_impl_unittest.cc
+++ b/sync/internal_api/sync_context_proxy_impl_unittest.cc
@@ -8,6 +8,7 @@
#include <vector>
#include "base/bind.h"
+#include "base/memory/ptr_util.h"
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
#include "base/sequenced_task_runner.h"
@@ -54,14 +55,14 @@ class SyncContextProxyImplTest : public ::testing::Test, FakeModelTypeService {
}
void OnReadyToConnect(syncer::SyncError error,
- scoped_ptr<ActivationContext> context) {
+ std::unique_ptr<ActivationContext> context) {
context_proxy_->ConnectTypeToSync(syncer::THEMES, std::move(context));
}
- scoped_ptr<SharedModelTypeProcessor> CreateModelTypeProcessor() {
- scoped_ptr<SharedModelTypeProcessor> processor =
- make_scoped_ptr(new SharedModelTypeProcessor(syncer::THEMES, this));
- processor->OnMetadataLoaded(make_scoped_ptr(new MetadataBatch()));
+ std::unique_ptr<SharedModelTypeProcessor> CreateModelTypeProcessor() {
+ std::unique_ptr<SharedModelTypeProcessor> processor =
+ base::WrapUnique(new SharedModelTypeProcessor(syncer::THEMES, this));
+ processor->OnMetadataLoaded(base::WrapUnique(new MetadataBatch()));
return processor;
}
@@ -73,14 +74,15 @@ class SyncContextProxyImplTest : public ::testing::Test, FakeModelTypeService {
std::vector<scoped_refptr<syncer::ModelSafeWorker>> workers_;
syncer::TestDirectorySetterUpper dir_maker_;
syncer::MockNudgeHandler nudge_handler_;
- scoped_ptr<syncer::ModelTypeRegistry> registry_;
+ std::unique_ptr<syncer::ModelTypeRegistry> registry_;
- scoped_ptr<SyncContextProxyImpl> context_proxy_;
+ std::unique_ptr<SyncContextProxyImpl> context_proxy_;
};
// Try to connect a type to a SyncContext that has already shut down.
TEST_F(SyncContextProxyImplTest, FailToConnect1) {
- scoped_ptr<SharedModelTypeProcessor> processor = CreateModelTypeProcessor();
+ std::unique_ptr<SharedModelTypeProcessor> processor =
+ CreateModelTypeProcessor();
DisableSync();
OnSyncStarting(processor.get());
@@ -91,7 +93,8 @@ TEST_F(SyncContextProxyImplTest, FailToConnect1) {
// Try to connect a type to a SyncContext as it shuts down.
TEST_F(SyncContextProxyImplTest, FailToConnect2) {
- scoped_ptr<SharedModelTypeProcessor> processor = CreateModelTypeProcessor();
+ std::unique_ptr<SharedModelTypeProcessor> processor =
+ CreateModelTypeProcessor();
OnSyncStarting(processor.get());
DisableSync();
@@ -102,7 +105,8 @@ TEST_F(SyncContextProxyImplTest, FailToConnect2) {
// Tests the case where the type's sync proxy shuts down first.
TEST_F(SyncContextProxyImplTest, TypeDisconnectsFirst) {
- scoped_ptr<SharedModelTypeProcessor> processor = CreateModelTypeProcessor();
+ std::unique_ptr<SharedModelTypeProcessor> processor =
+ CreateModelTypeProcessor();
OnSyncStarting(processor.get());
base::RunLoop run_loop_;
@@ -114,7 +118,8 @@ TEST_F(SyncContextProxyImplTest, TypeDisconnectsFirst) {
// Tests the case where the sync thread shuts down first.
TEST_F(SyncContextProxyImplTest, SyncDisconnectsFirst) {
- scoped_ptr<SharedModelTypeProcessor> processor = CreateModelTypeProcessor();
+ std::unique_ptr<SharedModelTypeProcessor> processor =
+ CreateModelTypeProcessor();
OnSyncStarting(processor.get());
base::RunLoop run_loop_;

Powered by Google App Engine
This is Rietveld 408576698