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

Side by Side Diff: remoting/protocol/jingle_session_manager.h

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 #ifndef REMOTING_PROTOCOL_JINGLE_SESSION_MANAGER_H_ 5 #ifndef REMOTING_PROTOCOL_JINGLE_SESSION_MANAGER_H_
6 #define REMOTING_PROTOCOL_JINGLE_SESSION_MANAGER_H_ 6 #define REMOTING_PROTOCOL_JINGLE_SESSION_MANAGER_H_
7 7
8 #include <list> 8 #include <list>
9 #include <string> 9 #include <string>
10 10
(...skipping 26 matching lines...) Expand all
37 public SignalStrategy::Listener { 37 public SignalStrategy::Listener {
38 public: 38 public:
39 virtual ~JingleSessionManager(); 39 virtual ~JingleSessionManager();
40 40
41 JingleSessionManager(base::MessageLoopProxy* message_loop); 41 JingleSessionManager(base::MessageLoopProxy* message_loop);
42 42
43 // SessionManager interface. 43 // SessionManager interface.
44 virtual void Init(SignalStrategy* signal_strategy, 44 virtual void Init(SignalStrategy* signal_strategy,
45 SessionManager::Listener* listener, 45 SessionManager::Listener* listener,
46 const NetworkSettings& network_settings) OVERRIDE; 46 const NetworkSettings& network_settings) OVERRIDE;
47 virtual Session* Connect( 47 virtual scoped_ptr<Session> Connect(
48 const std::string& host_jid, 48 const std::string& host_jid,
49 Authenticator* authenticator, 49 scoped_ptr<Authenticator> authenticator,
50 CandidateSessionConfig* config, 50 scoped_ptr<CandidateSessionConfig> config,
51 const Session::StateChangeCallback& state_change_callback) OVERRIDE; 51 const Session::StateChangeCallback& state_change_callback) OVERRIDE;
52 virtual void Close() OVERRIDE; 52 virtual void Close() OVERRIDE;
53 virtual void set_authenticator_factory( 53 virtual void set_authenticator_factory(
54 scoped_ptr<AuthenticatorFactory> authenticator_factory) OVERRIDE; 54 scoped_ptr<AuthenticatorFactory> authenticator_factory) OVERRIDE;
55 55
56 // cricket::SessionClient interface. 56 // cricket::SessionClient interface.
57 virtual void OnSessionCreate(cricket::Session* cricket_session, 57 virtual void OnSessionCreate(cricket::Session* cricket_session,
58 bool received_initiate) OVERRIDE; 58 bool received_initiate) OVERRIDE;
59 virtual void OnSessionDestroy(cricket::Session* cricket_session) OVERRIDE; 59 virtual void OnSessionDestroy(cricket::Session* cricket_session) OVERRIDE;
60 60
(...skipping 12 matching lines...) Expand all
73 73
74 private: 74 private:
75 friend class JingleSession; 75 friend class JingleSession;
76 76
77 // Called by JingleSession when a new connection is initiated. 77 // Called by JingleSession when a new connection is initiated.
78 SessionManager::IncomingSessionResponse AcceptConnection( 78 SessionManager::IncomingSessionResponse AcceptConnection(
79 JingleSession* jingle_session); 79 JingleSession* jingle_session);
80 80
81 // Creates authenticator for incoming session. Returns NULL if 81 // Creates authenticator for incoming session. Returns NULL if
82 // authenticator cannot be created, e.g. if |auth_message| is 82 // authenticator cannot be created, e.g. if |auth_message| is
83 // invalid. Caller reatins ownership of |auth_message| and must 83 // invalid.
84 // accept ownership of the result. 84 scoped_ptr<Authenticator> CreateAuthenticator(
85 Authenticator* CreateAuthenticator(const std::string& jid, 85 const std::string& jid,
86 const buzz::XmlElement* auth_message); 86 const buzz::XmlElement* auth_message);
87 87
88 // Called by JingleSession when it is being destroyed. 88 // Called by JingleSession when it is being destroyed.
89 void SessionDestroyed(JingleSession* jingle_session); 89 void SessionDestroyed(JingleSession* jingle_session);
90 90
91 // Callback for JingleInfoRequest. 91 // Callback for JingleInfoRequest.
92 void OnJingleInfo( 92 void OnJingleInfo(
93 const std::string& token, 93 const std::string& token,
94 const std::vector<std::string>& relay_hosts, 94 const std::vector<std::string>& relay_hosts,
95 const std::vector<talk_base::SocketAddress>& stun_hosts); 95 const std::vector<talk_base::SocketAddress>& stun_hosts);
96 96
(...skipping 19 matching lines...) Expand all
116 116
117 std::list<JingleSession*> sessions_; 117 std::list<JingleSession*> sessions_;
118 118
119 DISALLOW_COPY_AND_ASSIGN(JingleSessionManager); 119 DISALLOW_COPY_AND_ASSIGN(JingleSessionManager);
120 }; 120 };
121 121
122 } // namespace protocol 122 } // namespace protocol
123 } // namespace remoting 123 } // namespace remoting
124 124
125 #endif // REMOTING_PROTOCOL_JINGLE_SESSION_MANAGER_H_ 125 #endif // REMOTING_PROTOCOL_JINGLE_SESSION_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698