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

Unified Diff: remoting/protocol/jingle_session_manager.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/jingle_session_manager.cc
diff --git a/remoting/protocol/jingle_session_manager.cc b/remoting/protocol/jingle_session_manager.cc
index 60d84e7280d96f08be4674230cb5c61e28a21a52..2d3d09419d64f5e4cb97bcb13c0e380f331f1d5d 100644
--- a/remoting/protocol/jingle_session_manager.cc
+++ b/remoting/protocol/jingle_session_manager.cc
@@ -122,10 +122,10 @@ void JingleSessionManager::set_authenticator_factory(
authenticator_factory_ = authenticator_factory.Pass();
}
-Session* JingleSessionManager::Connect(
+scoped_ptr<Session> JingleSessionManager::Connect(
const std::string& host_jid,
- Authenticator* authenticator,
- CandidateSessionConfig* candidate_config,
+ scoped_ptr<Authenticator> authenticator,
+ scoped_ptr<CandidateSessionConfig> config,
const Session::StateChangeCallback& state_change_callback) {
DCHECK(CalledOnValidThread());
@@ -134,14 +134,14 @@ Session* JingleSessionManager::Connect(
cricket_session->set_remote_name(host_jid);
JingleSession* jingle_session =
Wez 2012/01/19 03:18:17 Shouldn't this become a scoped_ptr, and the return
Sergey Ulanov 2012/01/19 20:11:42 Done. This is a case when Pass() doesn't work well
Wez 2012/01/19 23:23:41 Ah... the RValue template classes don't mirror the
- new JingleSession(this, cricket_session, authenticator);
- jingle_session->set_candidate_config(candidate_config);
+ new JingleSession(this, cricket_session, authenticator.Pass());
+ jingle_session->set_candidate_config(config.Pass());
jingle_session->SetStateChangeCallback(state_change_callback);
sessions_.push_back(jingle_session);
jingle_session->SendSessionInitiate();
- return jingle_session;
+ return scoped_ptr<Session>(jingle_session);
}
void JingleSessionManager::OnSessionCreate(
@@ -153,7 +153,7 @@ void JingleSessionManager::OnSessionCreate(
if (incoming) {
JingleSession* jingle_session =
- new JingleSession(this, cricket_session, NULL);
+ new JingleSession(this, cricket_session, scoped_ptr<Authenticator>());
Wez 2012/01/19 03:18:17 nit: Ouch; unfortunate. :-/
Sergey Ulanov 2012/01/19 20:11:42 I was considering removing that last parameter fro
Wez 2012/01/19 23:23:41 Agreed.
sessions_.push_back(jingle_session);
}
}

Powered by Google App Engine
This is Rietveld 408576698