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

Unified Diff: remoting/protocol/ssl_hmac_channel_authenticator.cc

Issue 9240033: Use scoped_ptr<>.Pass() to pass ownership in the remoting protocol code. (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 side-by-side diff with in-line comments
Download patch
Index: remoting/protocol/ssl_hmac_channel_authenticator.cc
diff --git a/remoting/protocol/ssl_hmac_channel_authenticator.cc b/remoting/protocol/ssl_hmac_channel_authenticator.cc
index 85775bbee519eae065d034b67a19d746d12d21ac..42ffe4491d659cd71eaa315c55030a5002e540be 100644
--- a/remoting/protocol/ssl_hmac_channel_authenticator.cc
+++ b/remoting/protocol/ssl_hmac_channel_authenticator.cc
@@ -22,24 +22,26 @@ namespace remoting {
namespace protocol {
// static
-SslHmacChannelAuthenticator* SslHmacChannelAuthenticator::CreateForClient(
+scoped_ptr<SslHmacChannelAuthenticator>
+SslHmacChannelAuthenticator::CreateForClient(
const std::string& remote_cert,
const std::string& auth_key) {
- SslHmacChannelAuthenticator* result =
- new SslHmacChannelAuthenticator(auth_key);
+ scoped_ptr<SslHmacChannelAuthenticator> result(
+ new SslHmacChannelAuthenticator(auth_key));
result->remote_cert_ = remote_cert;
- return result;
+ return result.Pass();
}
-SslHmacChannelAuthenticator* SslHmacChannelAuthenticator::CreateForHost(
+scoped_ptr<SslHmacChannelAuthenticator>
+SslHmacChannelAuthenticator::CreateForHost(
const std::string& local_cert,
crypto::RSAPrivateKey* local_private_key,
const std::string& auth_key) {
- SslHmacChannelAuthenticator* result =
- new SslHmacChannelAuthenticator(auth_key);
+ scoped_ptr<SslHmacChannelAuthenticator> result(
+ new SslHmacChannelAuthenticator(auth_key));
result->local_cert_ = local_cert;
result->local_private_key_ = local_private_key;
- return result;
+ return result.Pass();
}
SslHmacChannelAuthenticator::SslHmacChannelAuthenticator(

Powered by Google App Engine
This is Rietveld 408576698