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

Side by Side Diff: remoting/protocol/me2me_host_authenticator_factory.cc

Issue 1534193004: Use std::move() instead of scoped_ptr<>::Pass(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "remoting/protocol/me2me_host_authenticator_factory.h" 5 #include "remoting/protocol/me2me_host_authenticator_factory.h"
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "remoting/base/rsa_key_pair.h" 9 #include "remoting/base/rsa_key_pair.h"
10 #include "remoting/protocol/channel_authenticator.h" 10 #include "remoting/protocol/channel_authenticator.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 const SharedSecretHash& shared_secret_hash, 74 const SharedSecretHash& shared_secret_hash,
75 scoped_refptr<PairingRegistry> pairing_registry) { 75 scoped_refptr<PairingRegistry> pairing_registry) {
76 scoped_ptr<Me2MeHostAuthenticatorFactory> result( 76 scoped_ptr<Me2MeHostAuthenticatorFactory> result(
77 new Me2MeHostAuthenticatorFactory()); 77 new Me2MeHostAuthenticatorFactory());
78 result->use_service_account_ = use_service_account; 78 result->use_service_account_ = use_service_account;
79 result->host_owner_ = host_owner; 79 result->host_owner_ = host_owner;
80 result->local_cert_ = local_cert; 80 result->local_cert_ = local_cert;
81 result->key_pair_ = key_pair; 81 result->key_pair_ = key_pair;
82 result->shared_secret_hash_ = shared_secret_hash; 82 result->shared_secret_hash_ = shared_secret_hash;
83 result->pairing_registry_ = pairing_registry; 83 result->pairing_registry_ = pairing_registry;
84 return result.Pass(); 84 return std::move(result);
Jamie 2015/12/22 12:23:36 Unnecessary?
Sergey Ulanov 2015/12/22 18:07:35 Necessary because upcasting.
85 } 85 }
86 86
87 87
88 // static 88 // static
89 scoped_ptr<AuthenticatorFactory> 89 scoped_ptr<AuthenticatorFactory>
90 Me2MeHostAuthenticatorFactory::CreateWithThirdPartyAuth( 90 Me2MeHostAuthenticatorFactory::CreateWithThirdPartyAuth(
91 bool use_service_account, 91 bool use_service_account,
92 const std::string& host_owner, 92 const std::string& host_owner,
93 const std::string& local_cert, 93 const std::string& local_cert,
94 scoped_refptr<RsaKeyPair> key_pair, 94 scoped_refptr<RsaKeyPair> key_pair,
95 scoped_ptr<TokenValidatorFactory> 95 scoped_ptr<TokenValidatorFactory>
96 token_validator_factory) { 96 token_validator_factory) {
97 scoped_ptr<Me2MeHostAuthenticatorFactory> result( 97 scoped_ptr<Me2MeHostAuthenticatorFactory> result(
98 new Me2MeHostAuthenticatorFactory()); 98 new Me2MeHostAuthenticatorFactory());
99 result->use_service_account_ = use_service_account; 99 result->use_service_account_ = use_service_account;
100 result->host_owner_ = host_owner; 100 result->host_owner_ = host_owner;
101 result->local_cert_ = local_cert; 101 result->local_cert_ = local_cert;
102 result->key_pair_ = key_pair; 102 result->key_pair_ = key_pair;
103 result->token_validator_factory_ = token_validator_factory.Pass(); 103 result->token_validator_factory_ = std::move(token_validator_factory);
104 return result.Pass(); 104 return std::move(result);
Jamie 2015/12/22 12:23:36 Unnecessary?
Sergey Ulanov 2015/12/22 18:07:35 Necessary because upcasting.
105 } 105 }
106 106
107 Me2MeHostAuthenticatorFactory::Me2MeHostAuthenticatorFactory() { 107 Me2MeHostAuthenticatorFactory::Me2MeHostAuthenticatorFactory() {
108 } 108 }
109 109
110 Me2MeHostAuthenticatorFactory::~Me2MeHostAuthenticatorFactory() { 110 Me2MeHostAuthenticatorFactory::~Me2MeHostAuthenticatorFactory() {
111 } 111 }
112 112
113 scoped_ptr<Authenticator> Me2MeHostAuthenticatorFactory::CreateAuthenticator( 113 scoped_ptr<Authenticator> Me2MeHostAuthenticatorFactory::CreateAuthenticator(
114 const std::string& local_jid, 114 const std::string& local_jid,
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 return NegotiatingHostAuthenticator::CreateWithSharedSecret( 152 return NegotiatingHostAuthenticator::CreateWithSharedSecret(
153 local_cert_, key_pair_, shared_secret_hash_.value, 153 local_cert_, key_pair_, shared_secret_hash_.value,
154 shared_secret_hash_.hash_function, pairing_registry_); 154 shared_secret_hash_.hash_function, pairing_registry_);
155 } 155 }
156 156
157 return make_scoped_ptr(new RejectingAuthenticator()); 157 return make_scoped_ptr(new RejectingAuthenticator());
158 } 158 }
159 159
160 } // namespace protocol 160 } // namespace protocol
161 } // namespace remoting 161 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698