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

Unified Diff: remoting/protocol/negotiating_client_authenticator.cc

Issue 1864213002: Convert //remoting to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mac IWYU 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: remoting/protocol/negotiating_client_authenticator.cc
diff --git a/remoting/protocol/negotiating_client_authenticator.cc b/remoting/protocol/negotiating_client_authenticator.cc
index ab4bd777495c5652f56480bdd1d4c7d0bec3ac0b..fc19c39373285814e2f765a0f0f5757011e16d42 100644
--- a/remoting/protocol/negotiating_client_authenticator.cc
+++ b/remoting/protocol/negotiating_client_authenticator.cc
@@ -11,6 +11,7 @@
#include "base/bind.h"
#include "base/callback.h"
#include "base/logging.h"
+#include "base/memory/ptr_util.h"
#include "base/strings/string_split.h"
#include "remoting/protocol/auth_util.h"
#include "remoting/protocol/channel_authenticator.h"
@@ -80,14 +81,15 @@ void NegotiatingClientAuthenticator::ProcessMessage(
ProcessMessageInternal(message, resume_callback);
}
-scoped_ptr<buzz::XmlElement> NegotiatingClientAuthenticator::GetNextMessage() {
+std::unique_ptr<buzz::XmlElement>
+NegotiatingClientAuthenticator::GetNextMessage() {
DCHECK_EQ(state(), MESSAGE_READY);
// This is the first message to the host, send a list of supported methods.
if (current_method_ == Method::INVALID) {
// If no authentication method has been chosen, see if we can optimistically
// choose one.
- scoped_ptr<buzz::XmlElement> result;
+ std::unique_ptr<buzz::XmlElement> result;
CreatePreferredAuthenticator();
if (current_authenticator_) {
DCHECK(current_authenticator_->state() == MESSAGE_READY);
@@ -147,7 +149,7 @@ void NegotiatingClientAuthenticator::CreateAuthenticatorForCurrentMethod(
PairingClientAuthenticator* pairing_authenticator =
new PairingClientAuthenticator(
config_, base::Bind(&V2Authenticator::CreateForClient));
- current_authenticator_ = make_scoped_ptr(pairing_authenticator);
+ current_authenticator_ = base::WrapUnique(pairing_authenticator);
pairing_authenticator->Start(preferred_initial_state, resume_callback);
break;
}
@@ -157,7 +159,7 @@ void NegotiatingClientAuthenticator::CreateAuthenticatorForCurrentMethod(
new PairingClientAuthenticator(
config_, base::Bind(&Spake2Authenticator::CreateForClient,
local_id_, remote_id_));
- current_authenticator_ = make_scoped_ptr(pairing_authenticator);
+ current_authenticator_ = base::WrapUnique(pairing_authenticator);
pairing_authenticator->Start(preferred_initial_state, resume_callback);
break;
}
@@ -181,7 +183,7 @@ void NegotiatingClientAuthenticator::CreatePreferredAuthenticator() {
PairingClientAuthenticator* pairing_authenticator =
new PairingClientAuthenticator(
config_, base::Bind(&V2Authenticator::CreateForClient));
- current_authenticator_ = make_scoped_ptr(pairing_authenticator);
+ current_authenticator_ = base::WrapUnique(pairing_authenticator);
pairing_authenticator->StartPaired(MESSAGE_READY);
current_method_ = Method::PAIRED_SPAKE2_P224;
}
« no previous file with comments | « remoting/protocol/negotiating_client_authenticator.h ('k') | remoting/protocol/negotiating_host_authenticator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698