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

Unified Diff: remoting/protocol/me2me_host_authenticator_factory.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/me2me_host_authenticator_factory.h ('k') | remoting/protocol/message_channel_factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/me2me_host_authenticator_factory.cc
diff --git a/remoting/protocol/me2me_host_authenticator_factory.cc b/remoting/protocol/me2me_host_authenticator_factory.cc
index 32281afae3224237f6a2a17016d411db67c4dd0a..18f99948c27b415fed837c755e57fa8ba0d15b79 100644
--- a/remoting/protocol/me2me_host_authenticator_factory.cc
+++ b/remoting/protocol/me2me_host_authenticator_factory.cc
@@ -7,6 +7,7 @@
#include <utility>
#include "base/base64.h"
+#include "base/memory/ptr_util.h"
#include "base/strings/string_util.h"
#include "remoting/base/rsa_key_pair.h"
#include "remoting/protocol/channel_authenticator.h"
@@ -20,7 +21,8 @@ namespace remoting {
namespace protocol {
// static
-scoped_ptr<AuthenticatorFactory> Me2MeHostAuthenticatorFactory::CreateWithPin(
+std::unique_ptr<AuthenticatorFactory>
+Me2MeHostAuthenticatorFactory::CreateWithPin(
bool use_service_account,
const std::string& host_owner,
const std::string& local_cert,
@@ -28,7 +30,7 @@ scoped_ptr<AuthenticatorFactory> Me2MeHostAuthenticatorFactory::CreateWithPin(
const std::string& required_client_domain,
const std::string& pin_hash,
scoped_refptr<PairingRegistry> pairing_registry) {
- scoped_ptr<Me2MeHostAuthenticatorFactory> result(
+ std::unique_ptr<Me2MeHostAuthenticatorFactory> result(
new Me2MeHostAuthenticatorFactory());
result->use_service_account_ = use_service_account;
result->host_owner_ = host_owner;
@@ -42,7 +44,7 @@ scoped_ptr<AuthenticatorFactory> Me2MeHostAuthenticatorFactory::CreateWithPin(
// static
-scoped_ptr<AuthenticatorFactory>
+std::unique_ptr<AuthenticatorFactory>
Me2MeHostAuthenticatorFactory::CreateWithThirdPartyAuth(
bool use_service_account,
const std::string& host_owner,
@@ -50,7 +52,7 @@ Me2MeHostAuthenticatorFactory::CreateWithThirdPartyAuth(
scoped_refptr<RsaKeyPair> key_pair,
const std::string& required_client_domain,
scoped_refptr<TokenValidatorFactory> token_validator_factory) {
- scoped_ptr<Me2MeHostAuthenticatorFactory> result(
+ std::unique_ptr<Me2MeHostAuthenticatorFactory> result(
new Me2MeHostAuthenticatorFactory());
result->use_service_account_ = use_service_account;
result->host_owner_ = host_owner;
@@ -65,10 +67,10 @@ Me2MeHostAuthenticatorFactory::Me2MeHostAuthenticatorFactory() {}
Me2MeHostAuthenticatorFactory::~Me2MeHostAuthenticatorFactory() {}
-scoped_ptr<Authenticator> Me2MeHostAuthenticatorFactory::CreateAuthenticator(
+std::unique_ptr<Authenticator>
+Me2MeHostAuthenticatorFactory::CreateAuthenticator(
const std::string& local_jid,
const std::string& remote_jid) {
-
std::string remote_jid_prefix;
if (!use_service_account_) {
@@ -78,7 +80,7 @@ scoped_ptr<Authenticator> Me2MeHostAuthenticatorFactory::CreateAuthenticator(
// account will have the same prefix.
if (!SplitJidResource(local_jid, &remote_jid_prefix, nullptr)) {
LOG(DFATAL) << "Invalid local JID:" << local_jid;
- return make_scoped_ptr(
+ return base::WrapUnique(
new RejectingAuthenticator(Authenticator::INVALID_CREDENTIALS));
}
} else {
@@ -94,7 +96,7 @@ scoped_ptr<Authenticator> Me2MeHostAuthenticatorFactory::CreateAuthenticator(
base::CompareCase::INSENSITIVE_ASCII)) {
LOG(ERROR) << "Rejecting incoming connection from " << remote_jid
<< ": Prefix mismatch.";
- return make_scoped_ptr(
+ return base::WrapUnique(
new RejectingAuthenticator(Authenticator::INVALID_CREDENTIALS));
}
@@ -110,7 +112,7 @@ scoped_ptr<Authenticator> Me2MeHostAuthenticatorFactory::CreateAuthenticator(
base::CompareCase::INSENSITIVE_ASCII)) {
LOG(ERROR) << "Rejecting incoming connection from " << remote_jid
<< ": Domain mismatch.";
- return make_scoped_ptr(
+ return base::WrapUnique(
new RejectingAuthenticator(Authenticator::INVALID_CREDENTIALS));
}
}
@@ -130,7 +132,7 @@ scoped_ptr<Authenticator> Me2MeHostAuthenticatorFactory::CreateAuthenticator(
pin_hash_, pairing_registry_);
}
- return make_scoped_ptr(
+ return base::WrapUnique(
new RejectingAuthenticator(Authenticator::INVALID_CREDENTIALS));
}
« no previous file with comments | « remoting/protocol/me2me_host_authenticator_factory.h ('k') | remoting/protocol/message_channel_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698