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

Unified Diff: components/sync/driver/generic_change_processor_unittest.cc

Issue 2422253002: [Sync] Rewriting ".reset(new" pattern to use "= base::MakeUnique" instead. (Closed)
Patch Set: Fixing compile. Created 4 years, 2 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/generic_change_processor_unittest.cc
diff --git a/components/sync/driver/generic_change_processor_unittest.cc b/components/sync/driver/generic_change_processor_unittest.cc
index 9cc9c20f760c843489d5a4f02d75524946a19119..e4f74d78b99d5ccb317d29f7a9c2d497c125e362 100644
--- a/components/sync/driver/generic_change_processor_unittest.cc
+++ b/components/sync/driver/generic_change_processor_unittest.cc
@@ -8,6 +8,7 @@
#include <utility>
+#include "base/memory/ptr_util.h"
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
#include "base/strings/stringprintf.h"
@@ -145,11 +146,12 @@ class SyncGenericChangeProcessorTest : public testing::Test {
// model type |type|.
void InitializeForType(ModelType type) {
TearDown();
- test_user_share_.reset(new TestUserShare);
+ test_user_share_ = base::MakeUnique<TestUserShare>();
test_user_share_->SetUp();
- sync_merge_result_.reset(new SyncMergeResult(type));
- merge_result_ptr_factory_.reset(
- new base::WeakPtrFactory<SyncMergeResult>(sync_merge_result_.get()));
+ sync_merge_result_ = base::MakeUnique<SyncMergeResult>(type);
+ merge_result_ptr_factory_ =
+ base::MakeUnique<base::WeakPtrFactory<SyncMergeResult>>(
+ sync_merge_result_.get());
ModelTypeSet types = ProtocolTypes();
for (ModelTypeSet::Iterator iter = types.First(); iter.Good(); iter.Inc()) {
@@ -162,11 +164,11 @@ class SyncGenericChangeProcessorTest : public testing::Test {
void ConstructGenericChangeProcessor(ModelType type) {
std::unique_ptr<AttachmentStore> attachment_store =
AttachmentStore::CreateInMemoryStore();
- change_processor_.reset(new GenericChangeProcessor(
+ change_processor_ = base::MakeUnique<GenericChangeProcessor>(
type, base::MakeUnique<DataTypeErrorHandlerMock>(),
syncable_service_ptr_factory_.GetWeakPtr(),
merge_result_ptr_factory_->GetWeakPtr(), test_user_share_->user_share(),
- &sync_client_, attachment_store->CreateAttachmentStoreForSync()));
+ &sync_client_, attachment_store->CreateAttachmentStoreForSync());
mock_attachment_service_ = sync_factory_.GetMockAttachmentService();
}
« no previous file with comments | « components/sync/driver/generic_change_processor.cc ('k') | components/sync/driver/glue/sync_backend_host_core.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698