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

Unified Diff: components/sync/engine_impl/worker_entity_tracker.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/engine_impl/worker_entity_tracker.cc
diff --git a/components/sync/engine_impl/worker_entity_tracker.cc b/components/sync/engine_impl/worker_entity_tracker.cc
index 2e0ca7bfb65e0c6e293915302b4d1becbc147779..f8cf9e39613141127d182f929b69867b146b3e2a 100644
--- a/components/sync/engine_impl/worker_entity_tracker.cc
+++ b/components/sync/engine_impl/worker_entity_tracker.cc
@@ -7,6 +7,7 @@
#include <algorithm>
#include "base/logging.h"
+#include "base/memory/ptr_util.h"
#include "components/sync/base/model_type.h"
#include "components/sync/base/time.h"
#include "components/sync/syncable/syncable_util.h"
@@ -82,7 +83,7 @@ void WorkerEntityTracker::RequestCommit(const CommitRequestData& data) {
DCHECK_EQ(client_tag_hash_, data.entity->client_tag_hash);
// TODO(stanisc): consider simply copying CommitRequestData instead of
// allocating one dynamically.
- pending_commit_.reset(new CommitRequestData(data));
+ pending_commit_ = base::MakeUnique<CommitRequestData>(data);
// Do our counter values indicate a conflict? If so, don't commit.
//
@@ -150,7 +151,7 @@ bool WorkerEntityTracker::ReceiveEncryptedUpdate(
return false;
highest_gu_response_version_ = data.response_version;
- encrypted_update_.reset(new UpdateResponseData(data));
+ encrypted_update_ = base::MakeUnique<UpdateResponseData>(data);
ClearPendingCommit();
return true;
}

Powered by Google App Engine
This is Rietveld 408576698