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

Unified Diff: remoting/protocol/pepper_session.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/pepper_session.cc
diff --git a/remoting/protocol/pepper_session.cc b/remoting/protocol/pepper_session.cc
index 7cf01397dbcbb6fce53f8b3898085e73d57f17d4..5751aba3fae8027776762eab7ba37d51aa348124 100644
--- a/remoting/protocol/pepper_session.cc
+++ b/remoting/protocol/pepper_session.cc
@@ -56,16 +56,16 @@ Session::Error PepperSession::error() {
void PepperSession::StartConnection(
const std::string& peer_jid,
- Authenticator* authenticator,
- CandidateSessionConfig* config,
+ scoped_ptr<Authenticator> authenticator,
+ scoped_ptr<CandidateSessionConfig> config,
const StateChangeCallback& state_change_callback) {
DCHECK(CalledOnValidThread());
- DCHECK(authenticator);
+ DCHECK(authenticator.get());
DCHECK_EQ(authenticator->state(), Authenticator::MESSAGE_READY);
peer_jid_ = peer_jid;
- authenticator_.reset(authenticator);
- candidate_config_.reset(config);
+ authenticator_ = authenticator.Pass();
+ candidate_config_ = config.Pass();
state_change_callback_ = state_change_callback;
// Generate random session ID. There are usually not more than 1
@@ -113,14 +113,14 @@ void PepperSession::CreateStreamChannel(
const StreamChannelCallback& callback) {
DCHECK(!channels_[name]);
- ChannelAuthenticator* channel_authenticator =
+ scoped_ptr<ChannelAuthenticator> channel_authenticator =
authenticator_->CreateChannelAuthenticator();
PepperStreamChannel* channel = new PepperStreamChannel(
this, name, callback);
channels_[name] = channel;
channel->Connect(session_manager_->pp_instance_,
session_manager_->transport_config_,
- channel_authenticator);
+ channel_authenticator.Pass());
}
void PepperSession::CreateDatagramChannel(
@@ -334,7 +334,7 @@ void PepperSession::ProcessAuthenticationStep() {
if (authenticator_->state() == Authenticator::MESSAGE_READY) {
JingleMessage message(peer_jid_, JingleMessage::SESSION_INFO, session_id_);
- message.info.reset(authenticator_->GetNextMessage());
+ message.info = authenticator_->GetNextMessage();
DCHECK(message.info.get());
session_info_request_.reset(session_manager_->iq_sender()->SendIq(

Powered by Google App Engine
This is Rietveld 408576698