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

Unified Diff: remoting/protocol/jingle_session_manager.h

Issue 8619011: Use Authenticator interface in Session and SessionManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 9 years, 1 month 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.h
diff --git a/remoting/protocol/jingle_session_manager.h b/remoting/protocol/jingle_session_manager.h
index 73f2530d39236ae7b5b5f9cc9baa804168e7e669..5da439b2ef3af513f82c083e4806eedc34057197 100644
--- a/remoting/protocol/jingle_session_manager.h
+++ b/remoting/protocol/jingle_session_manager.h
@@ -39,22 +39,21 @@ class JingleSessionManager
JingleSessionManager(base::MessageLoopProxy* message_loop);
+ void set_allow_local_ips(bool allow_local_ips);
Wez 2011/11/25 06:54:11 Can we just remove this? I don't think we have an
Sergey Ulanov 2011/11/28 18:55:16 Done.
Sergey Ulanov 2011/11/28 21:36:17 Actually we do need this to allow connections from
+
// SessionManager interface.
virtual void Init(const std::string& local_jid,
SignalStrategy* signal_strategy,
Listener* listener,
- crypto::RSAPrivateKey* private_key,
- const std::string& certificate,
bool allow_nat_traversal) OVERRIDE;
virtual Session* Connect(
const std::string& host_jid,
- const std::string& host_public_key,
- const std::string& client_token,
+ Authenticator* authenticator,
CandidateSessionConfig* config,
const Session::StateChangeCallback& state_change_callback) OVERRIDE;
virtual void Close() OVERRIDE;
-
- void set_allow_local_ips(bool allow_local_ips);
+ virtual void set_authenticator_factory(
+ AuthenticatorFactory* authenticator_factory) OVERRIDE;
// cricket::SessionClient interface.
virtual void OnSessionCreate(cricket::Session* cricket_session,
@@ -73,10 +72,16 @@ class JingleSessionManager
private:
friend class JingleSession;
- // Called by JingleSession when a new connection is
- // initiated. Returns true if session is accepted.
- bool AcceptConnection(JingleSession* jingle_session,
- cricket::Session* cricket_session);
+ // Called by JingleSession when a new connection is initiated.
+ SessionManager::IncomingSessionResponse AcceptConnection(
+ JingleSession* jingle_session);
+
+ // Creates authenticator for incoming session. Returns NULL if
+ // authenticator cannot be created, e.g. if |auth_message| is
+ // invalid. Caller reatins ownership of |auth_message| and must
+ // accept ownership of the result.
+ Authenticator* CreateAuthenticator(const std::string& jid,
+ const buzz::XmlElement* auth_message);
// Called by JingleSession when it is being destroyed.
void SessionDestroyed(JingleSession* jingle_session);
@@ -87,15 +92,6 @@ class JingleSessionManager
const std::vector<std::string>& relay_hosts,
const std::vector<talk_base::SocketAddress>& stun_hosts);
- // Creates session description for outgoing session.
- static cricket::SessionDescription* CreateClientSessionDescription(
- const CandidateSessionConfig* candidate_config,
- const std::string& auth_token);
- // Creates session description for incoming session.
- static cricket::SessionDescription* CreateHostSessionDescription(
- const CandidateSessionConfig* candidate_config,
- const std::string& certificate);
-
scoped_refptr<base::MessageLoopProxy> message_loop_;
scoped_ptr<talk_base::NetworkManager> network_manager_;
@@ -103,9 +99,8 @@ class JingleSessionManager
std::string local_jid_; // Full jid for the local side of the session.
SignalStrategy* signal_strategy_;
+ scoped_ptr<AuthenticatorFactory> authenticator_factory_;
Listener* listener_;
- std::string certificate_;
- scoped_ptr<crypto::RSAPrivateKey> private_key_;
bool allow_nat_traversal_;
bool allow_local_ips_;

Powered by Google App Engine
This is Rietveld 408576698