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

Unified Diff: remoting/protocol/me2me_host_authenticator_factory.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/me2me_host_authenticator_factory.cc
diff --git a/remoting/protocol/me2me_host_authenticator_factory.cc b/remoting/protocol/me2me_host_authenticator_factory.cc
index 758f531f4df0d1498b1953bfb5af8575a2cf064c..db7cc4c82ae6bafed8dee2b760d6b5b1f7df2047 100644
--- a/remoting/protocol/me2me_host_authenticator_factory.cc
+++ b/remoting/protocol/me2me_host_authenticator_factory.cc
@@ -28,13 +28,13 @@ Me2MeHostAuthenticatorFactory::Me2MeHostAuthenticatorFactory(
Me2MeHostAuthenticatorFactory::~Me2MeHostAuthenticatorFactory() {
}
-Authenticator* Me2MeHostAuthenticatorFactory::CreateAuthenticator(
+scoped_ptr<Authenticator> Me2MeHostAuthenticatorFactory::CreateAuthenticator(
const std::string& remote_jid,
const buzz::XmlElement* first_message) {
// Reject incoming connection if the client's jid is not an ASCII string.
if (!IsStringASCII(remote_jid)) {
LOG(ERROR) << "Rejecting incoming connection from " << remote_jid;
- return NULL;
+ return scoped_ptr<Authenticator>(NULL);
}
// Check that the client has the same bare jid as the host, i.e.
@@ -42,7 +42,7 @@ Authenticator* Me2MeHostAuthenticatorFactory::CreateAuthenticator(
// insensitive.
if (!StartsWithASCII(remote_jid, local_jid_prefix_, false)) {
LOG(ERROR) << "Rejecting incoming connection from " << remote_jid;
- return NULL;
+ return scoped_ptr<Authenticator>(NULL);
}
// TODO(sergeyu): V2 authenticator is not finished yet. Enable it
@@ -55,8 +55,9 @@ Authenticator* Me2MeHostAuthenticatorFactory::CreateAuthenticator(
// TODO(sergeyu): Old clients still use V1 auth protocol. Remove
// this once we are done migrating to V2.
- return new V1HostAuthenticator(local_cert_, *local_private_key_,
- shared_secret_, remote_jid);
+ return scoped_ptr<Authenticator>(new V1HostAuthenticator(
Wez 2012/01/19 23:23:41 It feels like the scoped_ptr<> shouldn't be needed
Sergey Ulanov 2012/01/19 23:50:26 Yep, it doesn't work without scoped_ptr<>.
+ local_cert_, *local_private_key_,
+ shared_secret_, remote_jid));
}
} // namespace protocol

Powered by Google App Engine
This is Rietveld 408576698