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

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

Issue 9283028: Add scoped_ptr<>::PassAs<>(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 8 years, 11 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 unified diff | Download patch | Annotate | Revision Log
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/v1_authenticator.h" 5 #include "remoting/protocol/v1_authenticator.h"
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "crypto/rsa_private_key.h" 9 #include "crypto/rsa_private_key.h"
10 #include "remoting/base/constants.h" 10 #include "remoting/base/constants.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 return message.Pass(); 74 return message.Pass();
75 } 75 }
76 76
77 scoped_ptr<ChannelAuthenticator> 77 scoped_ptr<ChannelAuthenticator>
78 V1ClientAuthenticator::CreateChannelAuthenticator() const { 78 V1ClientAuthenticator::CreateChannelAuthenticator() const {
79 DCHECK_EQ(state_, ACCEPTED); 79 DCHECK_EQ(state_, ACCEPTED);
80 scoped_ptr<SslHmacChannelAuthenticator> result = 80 scoped_ptr<SslHmacChannelAuthenticator> result =
81 SslHmacChannelAuthenticator::CreateForClient( 81 SslHmacChannelAuthenticator::CreateForClient(
82 remote_cert_, shared_secret_); 82 remote_cert_, shared_secret_);
83 result->SetLegacyOneWayMode(SslHmacChannelAuthenticator::SEND_ONLY); 83 result->SetLegacyOneWayMode(SslHmacChannelAuthenticator::SEND_ONLY);
84 return scoped_ptr<ChannelAuthenticator>(result.Pass()); 84 return result.PassAs<ChannelAuthenticator>();
85 }; 85 };
86 86
87 V1HostAuthenticator::V1HostAuthenticator( 87 V1HostAuthenticator::V1HostAuthenticator(
88 const std::string& local_cert, 88 const std::string& local_cert,
89 const crypto::RSAPrivateKey& local_private_key, 89 const crypto::RSAPrivateKey& local_private_key,
90 const std::string& shared_secret, 90 const std::string& shared_secret,
91 const std::string& remote_jid) 91 const std::string& remote_jid)
92 : local_cert_(local_cert), 92 : local_cert_(local_cert),
93 local_private_key_(local_private_key.Copy()), 93 local_private_key_(local_private_key.Copy()),
94 shared_secret_(shared_secret), 94 shared_secret_(shared_secret),
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 return message.Pass(); 134 return message.Pass();
135 } 135 }
136 136
137 scoped_ptr<ChannelAuthenticator> 137 scoped_ptr<ChannelAuthenticator>
138 V1HostAuthenticator::CreateChannelAuthenticator() const { 138 V1HostAuthenticator::CreateChannelAuthenticator() const {
139 DCHECK_EQ(state_, ACCEPTED); 139 DCHECK_EQ(state_, ACCEPTED);
140 scoped_ptr<SslHmacChannelAuthenticator> result = 140 scoped_ptr<SslHmacChannelAuthenticator> result =
141 SslHmacChannelAuthenticator::CreateForHost( 141 SslHmacChannelAuthenticator::CreateForHost(
142 local_cert_, local_private_key_.get(), shared_secret_); 142 local_cert_, local_private_key_.get(), shared_secret_);
143 result->SetLegacyOneWayMode(SslHmacChannelAuthenticator::RECEIVE_ONLY); 143 result->SetLegacyOneWayMode(SslHmacChannelAuthenticator::RECEIVE_ONLY);
144 return scoped_ptr<ChannelAuthenticator>(result.Pass()); 144 return result.PassAs<ChannelAuthenticator>();
145 }; 145 };
146 146
147 } // namespace remoting 147 } // namespace remoting
148 } // namespace protocol 148 } // namespace protocol
OLDNEW
« base/memory/scoped_ptr.h ('K') | « remoting/protocol/pepper_session_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698