summaryrefslogtreecommitdiffstats
path: root/remoting/protocol/jingle_session.h
diff options
context:
space:
mode:
authorsergeyu <sergeyu@chromium.org>2014-09-12 13:43:01 -0700
committerCommit bot <commit-bot@chromium.org>2014-09-12 20:49:52 +0000
commit9cb142f0cb33af89ff478e69e803fdf32f09006e (patch)
tree20fdc88e708d5b247b6c6f84416c8a7fcabfdfdd /remoting/protocol/jingle_session.h
parent02247c02b993b041e0da5a1f03e2f173ff81e888 (diff)
downloadchromium_src-9cb142f0cb33af89ff478e69e803fdf32f09006e.zip
chromium_src-9cb142f0cb33af89ff478e69e803fdf32f09006e.tar.gz
chromium_src-9cb142f0cb33af89ff478e69e803fdf32f09006e.tar.bz2
Move PseudoTCP and channel auth out of LibjingleTransportFactory.
Previously TransportFactory interface was responsible for creation and initialization of several protocol layers, including PseudoTCP and authentication (TLS). Simplified it so now it only creates raw datagram transport channel. PseudoTcpChannelFactory is now responsible for setting up PseudoTcpAdapter and AuthenticatingChannelFactory takes care of channel authentication. Also added DatagramChannelFactory for Datagram channels. This change will make it possible to replace PseudoTcpChannelFactory with an object that creates SCTP-based channels. Also fixed a bug in SslHmacChannelAuthenticator. It wasn't working properly when deleted from the callback. (base::Callback objects shouldn't be deleted while being called because when deleted they also destroy reference parameters values they are holding). BUG=402993 Review URL: https://codereview.chromium.org/551173004 Cr-Commit-Position: refs/heads/master@{#294653}
Diffstat (limited to 'remoting/protocol/jingle_session.h')
-rw-r--r--remoting/protocol/jingle_session.h20
1 files changed, 14 insertions, 6 deletions
diff --git a/remoting/protocol/jingle_session.h b/remoting/protocol/jingle_session.h
index dfb96cb..9ec6206 100644
--- a/remoting/protocol/jingle_session.h
+++ b/remoting/protocol/jingle_session.h
@@ -15,7 +15,7 @@
#include "crypto/rsa_private_key.h"
#include "net/base/completion_callback.h"
#include "remoting/protocol/authenticator.h"
-#include "remoting/protocol/channel_factory.h"
+#include "remoting/protocol/datagram_channel_factory.h"
#include "remoting/protocol/jingle_messages.h"
#include "remoting/protocol/session.h"
#include "remoting/protocol/session_config.h"
@@ -30,14 +30,17 @@ class StreamSocket;
namespace remoting {
namespace protocol {
+class SecureChannelFactory;
class ChannelMultiplexer;
class JingleSessionManager;
+class PseudoTcpChannelFactory;
// JingleSessionManager and JingleSession implement the subset of the
// Jingle protocol used in Chromoting. Instances of this class are
// created by the JingleSessionManager.
-class JingleSession : public Session,
- public ChannelFactory,
+class JingleSession : public base::NonThreadSafe,
+ public Session,
+ public DatagramChannelFactory,
public Transport::EventHandler {
public:
virtual ~JingleSession();
@@ -49,11 +52,11 @@ class JingleSession : public Session,
virtual const CandidateSessionConfig* candidate_config() OVERRIDE;
virtual const SessionConfig& config() OVERRIDE;
virtual void set_config(const SessionConfig& config) OVERRIDE;
- virtual ChannelFactory* GetTransportChannelFactory() OVERRIDE;
- virtual ChannelFactory* GetMultiplexedChannelFactory() OVERRIDE;
+ virtual StreamChannelFactory* GetTransportChannelFactory() OVERRIDE;
+ virtual StreamChannelFactory* GetMultiplexedChannelFactory() OVERRIDE;
virtual void Close() OVERRIDE;
- // ChannelFactory interface.
+ // DatagramChannelFactory interface.
virtual void CreateChannel(const std::string& name,
const ChannelCreatedCallback& callback) OVERRIDE;
virtual void CancelChannelCreation(const std::string& name) OVERRIDE;
@@ -133,6 +136,9 @@ class JingleSession : public Session,
// Called after the authenticating step is finished.
void ContinueAuthenticationStep();
+ // Called when authentication is finished.
+ void OnAuthenticated();
+
// Terminates the session and sends session-terminate if it is
// necessary. |error| specifies the error code in case when the
// session is being closed due to an error.
@@ -165,6 +171,8 @@ class JingleSession : public Session,
std::list<IqRequest*> transport_info_requests_;
ChannelsMap channels_;
+ scoped_ptr<PseudoTcpChannelFactory> pseudotcp_channel_factory_;
+ scoped_ptr<SecureChannelFactory> secure_channel_factory_;
scoped_ptr<ChannelMultiplexer> channel_multiplexer_;
base::OneShotTimer<JingleSession> transport_infos_timer_;