diff options
author | sergeyu <sergeyu@chromium.org> | 2015-12-28 11:49:03 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-12-28 19:50:04 +0000 |
commit | e57676028aa68166bcffa1f234ec8770a4d73e8a (patch) | |
tree | 0c837118a1b722e4f9a08c9d32bf220f1014f5af /remoting/client | |
parent | 1102912e54a5c4954c80cab012dd869eac11fdf4 (diff) | |
download | chromium_src-e57676028aa68166bcffa1f234ec8770a4d73e8a.zip chromium_src-e57676028aa68166bcffa1f234ec8770a4d73e8a.tar.gz chromium_src-e57676028aa68166bcffa1f234ec8770a4d73e8a.tar.bz2 |
Move ownership of Transport out of Session.
Previously Session implementations were responsible for creation and
ownership of Transport objects. Now Connection* classes own both
Transport and Session instances. This allows to ensure that correct
type of transport is created (i.e. WebRTC connection uses
WebrtcTransport). It also makes it possible for the host to support
two types of connections similtaneously (previously Ice connections
were not working when the host was started with --enable-webrtc).
Session is no longer responsible for tracking state of the Transport,
so it doesn't need CONNECTED state anymore. Session just passes
transport-info messages to and from transport and the Connection
object is responsible for tracking the state of the transport.
BUG=547158
Review URL: https://codereview.chromium.org/1545743002
Cr-Commit-Position: refs/heads/master@{#367003}
Diffstat (limited to 'remoting/client')
-rw-r--r-- | remoting/client/chromoting_client.cc | 8 | ||||
-rw-r--r-- | remoting/client/chromoting_client.h | 1 |
2 files changed, 5 insertions, 4 deletions
diff --git a/remoting/client/chromoting_client.cc b/remoting/client/chromoting_client.cc index 4e5b53e..9a9506f 100644 --- a/remoting/client/chromoting_client.cc +++ b/remoting/client/chromoting_client.cc @@ -70,9 +70,7 @@ void ChromotingClient::Start( connection_->set_video_stub(video_renderer_->GetVideoStub()); connection_->set_audio_stub(audio_decode_scheduler_.get()); - session_manager_.reset(new protocol::JingleSessionManager( - make_scoped_ptr(new protocol::IceTransportFactory(transport_context)), - signal_strategy)); + session_manager_.reset(new protocol::JingleSessionManager(signal_strategy)); if (!protocol_config_) protocol_config_ = protocol::CandidateSessionConfig::CreateDefault(); @@ -81,6 +79,7 @@ void ChromotingClient::Start( session_manager_->set_protocol_config(std::move(protocol_config_)); authenticator_ = std::move(authenticator); + transport_context_ = transport_context; signal_strategy_ = signal_strategy; signal_strategy_->AddListener(this); @@ -202,7 +201,8 @@ bool ChromotingClient::OnSignalStrategyIncomingStanza( void ChromotingClient::StartConnection() { DCHECK(thread_checker_.CalledOnValidThread()); connection_->Connect( - session_manager_->Connect(host_jid_, std::move(authenticator_)), this); + session_manager_->Connect(host_jid_, std::move(authenticator_)), + transport_context_, this); } void ChromotingClient::OnAuthenticated() { diff --git a/remoting/client/chromoting_client.h b/remoting/client/chromoting_client.h index 1fe71fa..dffbc5a 100644 --- a/remoting/client/chromoting_client.h +++ b/remoting/client/chromoting_client.h @@ -123,6 +123,7 @@ class ChromotingClient : public SignalStrategy::Listener, std::string host_jid_; scoped_ptr<protocol::Authenticator> authenticator_; + scoped_refptr<protocol::TransportContext> transport_context_; scoped_ptr<protocol::SessionManager> session_manager_; scoped_ptr<protocol::ConnectionToHost> connection_; |