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

Unified Diff: remoting/protocol/v2_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
« no previous file with comments | « remoting/protocol/v2_authenticator.h ('k') | remoting/protocol/v2_authenticator_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/v2_authenticator.cc
diff --git a/remoting/protocol/v2_authenticator.cc b/remoting/protocol/v2_authenticator.cc
index a17fb466c116f9adc1ae7517b503652ba681d47d..9db2fefeb5bff2e4ec23d4f86cd6b7d1ea4e1942 100644
--- a/remoting/protocol/v2_authenticator.cc
+++ b/remoting/protocol/v2_authenticator.cc
@@ -8,6 +8,7 @@
#include "base/base64.h"
#include "base/logging.h"
+#include "base/memory/ptr_util.h"
#include "remoting/base/constants.h"
#include "remoting/base/rsa_key_pair.h"
#include "remoting/protocol/ssl_hmac_channel_authenticator.h"
@@ -33,20 +34,20 @@ bool V2Authenticator::IsEkeMessage(const buzz::XmlElement* message) {
}
// static
-scoped_ptr<Authenticator> V2Authenticator::CreateForClient(
+std::unique_ptr<Authenticator> V2Authenticator::CreateForClient(
const std::string& shared_secret,
Authenticator::State initial_state) {
- return make_scoped_ptr(new V2Authenticator(
+ return base::WrapUnique(new V2Authenticator(
P224EncryptedKeyExchange::kPeerTypeClient, shared_secret, initial_state));
}
// static
-scoped_ptr<Authenticator> V2Authenticator::CreateForHost(
+std::unique_ptr<Authenticator> V2Authenticator::CreateForHost(
const std::string& local_cert,
scoped_refptr<RsaKeyPair> key_pair,
const std::string& shared_secret,
Authenticator::State initial_state) {
- scoped_ptr<V2Authenticator> result(new V2Authenticator(
+ std::unique_ptr<V2Authenticator> result(new V2Authenticator(
P224EncryptedKeyExchange::kPeerTypeServer, shared_secret, initial_state));
result->local_cert_ = local_cert;
result->local_key_pair_ = key_pair;
@@ -150,10 +151,10 @@ void V2Authenticator::ProcessMessageInternal(const buzz::XmlElement* message) {
state_ = MESSAGE_READY;
}
-scoped_ptr<buzz::XmlElement> V2Authenticator::GetNextMessage() {
+std::unique_ptr<buzz::XmlElement> V2Authenticator::GetNextMessage() {
DCHECK_EQ(state(), MESSAGE_READY);
- scoped_ptr<buzz::XmlElement> message = CreateEmptyAuthenticatorMessage();
+ std::unique_ptr<buzz::XmlElement> message = CreateEmptyAuthenticatorMessage();
DCHECK(!pending_messages_.empty());
while (!pending_messages_.empty()) {
@@ -187,7 +188,7 @@ const std::string& V2Authenticator::GetAuthKey() const {
return auth_key_;
}
-scoped_ptr<ChannelAuthenticator>
+std::unique_ptr<ChannelAuthenticator>
V2Authenticator::CreateChannelAuthenticator() const {
DCHECK_EQ(state(), ACCEPTED);
CHECK(!auth_key_.empty());
« no previous file with comments | « remoting/protocol/v2_authenticator.h ('k') | remoting/protocol/v2_authenticator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698