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

Unified Diff: components/proximity_auth/device_to_device_authenticator.cc

Issue 2250023005: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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/proximity_auth/device_to_device_authenticator.cc
diff --git a/components/proximity_auth/device_to_device_authenticator.cc b/components/proximity_auth/device_to_device_authenticator.cc
index 30d88bbe04bb0c6ab65c888b6e8ca2f51065eacb..4dbe7fd5ce36c8e4aa0af8677f0cab840c160556 100644
--- a/components/proximity_auth/device_to_device_authenticator.cc
+++ b/components/proximity_auth/device_to_device_authenticator.cc
@@ -92,7 +92,7 @@ void DeviceToDeviceAuthenticator::OnKeyPairGenerated(
}
std::unique_ptr<base::Timer> DeviceToDeviceAuthenticator::CreateTimer() {
- return base::WrapUnique(new base::OneShotTimer());
+ return base::MakeUnique<base::OneShotTimer>();
}
void DeviceToDeviceAuthenticator::OnHelloMessageCreated(
@@ -115,7 +115,7 @@ void DeviceToDeviceAuthenticator::OnHelloMessageCreated(
hello_message_ = message;
std::string permit_id = kPermitIdPrefix + account_id_;
connection_->SendMessage(
- base::WrapUnique(new WireMessage(hello_message_, permit_id)));
+ base::MakeUnique<WireMessage>(hello_message_, permit_id));
}
void DeviceToDeviceAuthenticator::OnResponderAuthTimedOut() {
@@ -154,7 +154,7 @@ void DeviceToDeviceAuthenticator::OnInitiatorAuthCreated(
}
state_ = State::SENT_INITIATOR_AUTH;
- connection_->SendMessage(base::WrapUnique(new WireMessage(message)));
+ connection_->SendMessage(base::MakeUnique<WireMessage>(message));
}
void DeviceToDeviceAuthenticator::Fail(const std::string& error_message) {
@@ -181,9 +181,9 @@ void DeviceToDeviceAuthenticator::Succeed() {
connection_->RemoveObserver(this);
callback_.Run(
Result::SUCCESS,
- base::WrapUnique(new DeviceToDeviceSecureContext(
+ base::MakeUnique<DeviceToDeviceSecureContext>(
std::move(secure_message_delegate_), session_symmetric_key_,
- responder_auth_message_, SecureContext::PROTOCOL_VERSION_THREE_ONE)));
+ responder_auth_message_, SecureContext::PROTOCOL_VERSION_THREE_ONE));
}
void DeviceToDeviceAuthenticator::OnConnectionStatusChanged(

Powered by Google App Engine
This is Rietveld 408576698