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

Side by Side Diff: remoting/protocol/pepper_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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "remoting/protocol/pepper_session_manager.h" 5 #include "remoting/protocol/pepper_session_manager.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "remoting/jingle_glue/iq_sender.h" 8 #include "remoting/jingle_glue/iq_sender.h"
9 #include "remoting/jingle_glue/jingle_info_request.h" 9 #include "remoting/jingle_glue/jingle_info_request.h"
10 #include "remoting/jingle_glue/signal_strategy.h" 10 #include "remoting/jingle_glue/signal_strategy.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 VLOG(1) << "STUN server: " << transport_config_.stun_server 63 VLOG(1) << "STUN server: " << transport_config_.stun_server
64 << " Relay server: " << transport_config_.relay_server 64 << " Relay server: " << transport_config_.relay_server
65 << " Relay token: " << transport_config_.relay_token; 65 << " Relay token: " << transport_config_.relay_token;
66 66
67 if (!ready_) { 67 if (!ready_) {
68 ready_ = true; 68 ready_ = true;
69 listener_->OnSessionManagerReady(); 69 listener_->OnSessionManagerReady();
70 } 70 }
71 } 71 }
72 72
73 Session* PepperSessionManager::Connect( 73 scoped_ptr<Session> PepperSessionManager::Connect(
74 const std::string& host_jid, 74 const std::string& host_jid,
75 Authenticator* authenticator, 75 scoped_ptr<Authenticator> authenticator,
76 CandidateSessionConfig* config, 76 scoped_ptr<CandidateSessionConfig> config,
77 const Session::StateChangeCallback& state_change_callback) { 77 const Session::StateChangeCallback& state_change_callback) {
78 PepperSession* session = new PepperSession(this); 78 PepperSession* session = new PepperSession(this);
Wez 2012/01/19 03:18:17 Make this the scoped_ptr<>, and return Pass()?
Sergey Ulanov 2012/01/19 20:11:42 Done.
79 session->StartConnection(host_jid, authenticator, config, 79 session->StartConnection(host_jid, authenticator.Pass(), config.Pass(),
80 state_change_callback); 80 state_change_callback);
81 sessions_[session->session_id_] = session; 81 sessions_[session->session_id_] = session;
82 return session; 82 return scoped_ptr<Session>(session);
83 } 83 }
84 84
85 void PepperSessionManager::Close() { 85 void PepperSessionManager::Close() {
86 DCHECK(CalledOnValidThread()); 86 DCHECK(CalledOnValidThread());
87 87
88 // Close() can be called only after all sessions are destroyed. 88 // Close() can be called only after all sessions are destroyed.
89 DCHECK(sessions_.empty()); 89 DCHECK(sessions_.empty());
90 90
91 listener_ = NULL; 91 listener_ = NULL;
92 jingle_info_request_.reset(); 92 jingle_info_request_.reset();
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 buzz::XmlElement* stanza = reply.ToXml(original_stanza); 154 buzz::XmlElement* stanza = reply.ToXml(original_stanza);
155 signal_strategy_->SendStanza(stanza); 155 signal_strategy_->SendStanza(stanza);
156 } 156 }
157 157
158 void PepperSessionManager::SessionDestroyed(PepperSession* session) { 158 void PepperSessionManager::SessionDestroyed(PepperSession* session) {
159 sessions_.erase(session->session_id_); 159 sessions_.erase(session->session_id_);
160 } 160 }
161 161
162 } // namespace protocol 162 } // namespace protocol
163 } // namespace remoting 163 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698