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

Unified Diff: components/sync_driver/non_ui_model_type_controller_unittest.cc

Issue 1907683003: Convert //components/sync_driver from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Build fix, address feedback 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: components/sync_driver/non_ui_model_type_controller_unittest.cc
diff --git a/components/sync_driver/non_ui_model_type_controller_unittest.cc b/components/sync_driver/non_ui_model_type_controller_unittest.cc
index 2114c11ad3cc7e8f30ae45579c3d7840e0696ceb..cf4241bd96f22b596604700920a7656730198ea7 100644
--- a/components/sync_driver/non_ui_model_type_controller_unittest.cc
+++ b/components/sync_driver/non_ui_model_type_controller_unittest.cc
@@ -4,13 +4,14 @@
#include "components/sync_driver/non_ui_model_type_controller.h"
+#include <memory>
#include <utility>
#include "base/bind.h"
#include "base/callback.h"
#include "base/logging.h"
+#include "base/memory/ptr_util.h"
#include "base/memory/ref_counted.h"
-#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
@@ -70,11 +71,12 @@ class NullCommitQueue : public syncer_v2::CommitQueue {
// A class that pretends to be the sync backend.
class MockSyncBackend {
public:
- void Connect(syncer::ModelType type,
- scoped_ptr<syncer_v2::ActivationContext> activation_context) {
+ void Connect(
+ syncer::ModelType type,
+ std::unique_ptr<syncer_v2::ActivationContext> activation_context) {
enabled_types_.Put(type);
activation_context->type_processor->ConnectSync(
- make_scoped_ptr(new NullCommitQueue()));
+ base::WrapUnique(new NullCommitQueue()));
}
void Disconnect(syncer::ModelType type) {
@@ -118,9 +120,9 @@ class MockBackendDataTypeConfigurer
NOTREACHED() << "Not implemented.";
}
- void ActivateNonBlockingDataType(
- syncer::ModelType type,
- scoped_ptr<syncer_v2::ActivationContext> activation_context) override {
+ void ActivateNonBlockingDataType(syncer::ModelType type,
+ std::unique_ptr<syncer_v2::ActivationContext>
+ activation_context) override {
// Post on Sync thread just like the real implementation does.
sync_task_runner_->PostTask(
FROM_HERE,
@@ -175,11 +177,12 @@ class NonUIModelTypeControllerTest : public testing::Test,
}
protected:
- scoped_ptr<syncer_v2::ModelTypeChangeProcessor> CreateProcessor(
+ std::unique_ptr<syncer_v2::ModelTypeChangeProcessor> CreateProcessor(
syncer::ModelType type,
syncer_v2::ModelTypeService* service) {
- scoped_ptr<syncer_v2::SharedModelTypeProcessor> processor =
- make_scoped_ptr(new syncer_v2::SharedModelTypeProcessor(type, service));
+ std::unique_ptr<syncer_v2::SharedModelTypeProcessor> processor =
+ base::WrapUnique(
+ new syncer_v2::SharedModelTypeProcessor(type, service));
type_processor_ = processor.get();
return std::move(processor);
}
@@ -229,7 +232,7 @@ class NonUIModelTypeControllerTest : public testing::Test,
if (model_thread_runner_->BelongsToCurrentThread()) {
if (!type_processor_->IsAllowingChanges()) {
type_processor_->OnMetadataLoaded(
- make_scoped_ptr(new syncer_v2::MetadataBatch()));
+ base::WrapUnique(new syncer_v2::MetadataBatch()));
}
} else {
model_thread_runner_->PostTask(
@@ -324,7 +327,7 @@ class NonUIModelTypeControllerTest : public testing::Test,
scoped_refptr<base::TestSimpleTaskRunner> sync_thread_runner_;
MockSyncBackend backend_;
MockBackendDataTypeConfigurer configurer_;
- scoped_ptr<syncer_v2::FakeModelTypeService> service_;
+ std::unique_ptr<syncer_v2::FakeModelTypeService> service_;
};
TEST_F(NonUIModelTypeControllerTest, InitialState) {
« no previous file with comments | « components/sync_driver/non_ui_data_type_controller_unittest.cc ('k') | components/sync_driver/profile_sync_auth_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698