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

Unified Diff: remoting/protocol/v2_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/v2_authenticator.cc
diff --git a/remoting/protocol/v2_authenticator.cc b/remoting/protocol/v2_authenticator.cc
index edfc1cefd724211c83bfa579184570feec930d99..8ca1cb8df19afa44210d02b9d50fd7a62480c271 100644
--- a/remoting/protocol/v2_authenticator.cc
+++ b/remoting/protocol/v2_authenticator.cc
@@ -129,10 +129,10 @@ void V2Authenticator::ProcessMessage(const buzz::XmlElement* message) {
state_ = MESSAGE_READY;
}
-buzz::XmlElement* V2Authenticator::GetNextMessage() {
+scoped_ptr<buzz::XmlElement> V2Authenticator::GetNextMessage() {
DCHECK_EQ(state(), MESSAGE_READY);
- buzz::XmlElement* message = CreateEmptyAuthenticatorMessage();
+ scoped_ptr<buzz::XmlElement> message = CreateEmptyAuthenticatorMessage();
DCHECK(!pending_messages_.empty());
while (!pending_messages_.empty()) {
@@ -163,19 +163,22 @@ buzz::XmlElement* V2Authenticator::GetNextMessage() {
if (state_ != ACCEPTED) {
state_ = WAITING_MESSAGE;
}
- return message;
+ return message.Pass();
}
-ChannelAuthenticator* V2Authenticator::CreateChannelAuthenticator() const {
+scoped_ptr<ChannelAuthenticator>
+V2Authenticator::CreateChannelAuthenticator() const {
DCHECK_EQ(state(), ACCEPTED);
CHECK(!auth_key_.empty());
if (is_host_side()) {
- return SslHmacChannelAuthenticator::CreateForHost(
- local_cert_, local_private_key_.get(), auth_key_);
+ return scoped_ptr<ChannelAuthenticator>(
+ SslHmacChannelAuthenticator::CreateForHost(
+ local_cert_, local_private_key_.get(), auth_key_).release());
Wez 2012/01/19 03:18:17 .Pass()?
Sergey Ulanov 2012/01/19 20:11:42 Done.
} else {
- return SslHmacChannelAuthenticator::CreateForClient(
- remote_cert_, auth_key_);
+ return scoped_ptr<ChannelAuthenticator>(
+ SslHmacChannelAuthenticator::CreateForClient(
+ remote_cert_, auth_key_).release());
Wez 2012/01/19 03:18:17 .Pass()?
Sergey Ulanov 2012/01/19 20:11:42 Done.
}
}

Powered by Google App Engine
This is Rietveld 408576698