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

Unified Diff: components/sync/base/cryptographer.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/base/cryptographer.cc
diff --git a/components/sync/base/cryptographer.cc b/components/sync/base/cryptographer.cc
index b6c130abb311878a9c39b5bf57215c04aa318a95..c585965969ffff2d3edc56e83663ba37b468e002 100644
--- a/components/sync/base/cryptographer.cc
+++ b/components/sync/base/cryptographer.cc
@@ -11,6 +11,7 @@
#include "base/base64.h"
#include "base/logging.h"
+#include "base/memory/ptr_util.h"
#include "components/sync/base/encryptor.h"
#include "components/sync/protocol/nigori_specifics.pb.h"
@@ -41,7 +42,8 @@ Cryptographer::Cryptographer(const Cryptographer& other)
}
if (other.pending_keys_) {
- pending_keys_.reset(new sync_pb::EncryptedData(*(other.pending_keys_)));
+ pending_keys_ =
+ base::MakeUnique<sync_pb::EncryptedData>(*(other.pending_keys_));
}
}
@@ -230,7 +232,7 @@ void Cryptographer::SetDefaultKey(const std::string& key_name) {
void Cryptographer::SetPendingKeys(const sync_pb::EncryptedData& encrypted) {
DCHECK(!CanDecrypt(encrypted));
DCHECK(!encrypted.blob().empty());
- pending_keys_.reset(new sync_pb::EncryptedData(encrypted));
+ pending_keys_ = base::MakeUnique<sync_pb::EncryptedData>(encrypted);
}
const sync_pb::EncryptedData& Cryptographer::GetPendingKeys() const {
« no previous file with comments | « components/browser_sync/profile_sync_service_unittest.cc ('k') | components/sync/base/proto_value_ptr_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698