diff options
author | sergeyu <sergeyu@chromium.org> | 2015-12-16 14:45:00 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-12-16 22:46:17 +0000 |
commit | 86030f38b4a7be9418c50da7e83ff55749438dba (patch) | |
tree | a885f9e90179ee8ae6ad27c651bd2ddb704124da /remoting/client/jni | |
parent | 3b7c3e37ec089dc5179359a52a7b2311285c7f21 (diff) | |
download | chromium_src-86030f38b4a7be9418c50da7e83ff55749438dba.zip chromium_src-86030f38b4a7be9418c50da7e83ff55749438dba.tar.gz chromium_src-86030f38b4a7be9418c50da7e83ff55749438dba.tar.bz2 |
Add TransportContext class.
The new TransportContext is now used to store all parameters required
to initialize Transport objects and is applicable both to IceTransport
and WebrtcTransport. It also allowed to reduce amount of boilerplate
code when passing around these parameters.
BUG=547158
Review URL: https://codereview.chromium.org/1521883006
Cr-Commit-Position: refs/heads/master@{#365649}
Diffstat (limited to 'remoting/client/jni')
-rw-r--r-- | remoting/client/jni/chromoting_jni_instance.cc | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/remoting/client/jni/chromoting_jni_instance.cc b/remoting/client/jni/chromoting_jni_instance.cc index 0d5314e..535ca0f 100644 --- a/remoting/client/jni/chromoting_jni_instance.cc +++ b/remoting/client/jni/chromoting_jni_instance.cc @@ -21,10 +21,10 @@ #include "remoting/protocol/chromium_port_allocator.h" #include "remoting/protocol/chromium_socket_factory.h" #include "remoting/protocol/host_stub.h" -#include "remoting/protocol/ice_transport_factory.h" #include "remoting/protocol/negotiating_client_authenticator.h" #include "remoting/protocol/network_settings.h" #include "remoting/protocol/performance_tracker.h" +#include "remoting/protocol/transport_context.h" #include "remoting/signaling/server_log_entry.h" #include "ui/events/keycodes/dom/keycode_converter.h" @@ -423,17 +423,17 @@ void ChromotingJniInstance::ConnectToHostOnNetworkThread() { protocol::NetworkSettings::NAT_TRAVERSAL_FULL); // Use Chrome's network stack to allocate ports for peer-to-peer channels. - scoped_ptr<protocol::ChromiumPortAllocator> port_allocator( - protocol::ChromiumPortAllocator::Create(jni_runtime_->url_requester(), - network_settings)); + scoped_ptr<protocol::ChromiumPortAllocatorFactory> port_allocator_factory( + new protocol::ChromiumPortAllocatorFactory( + jni_runtime_->url_requester())); - scoped_ptr<protocol::TransportFactory> transport_factory( - new protocol::IceTransportFactory( - signaling_.get(), port_allocator.Pass(), network_settings, - protocol::TransportRole::CLIENT)); + scoped_refptr<protocol::TransportContext> transport_context = + new protocol::TransportContext( + signaling_.get(), port_allocator_factory.Pass(), network_settings, + protocol::TransportRole::CLIENT); - client_->Start(signaling_.get(), authenticator_.Pass(), - transport_factory.Pass(), host_jid_, capabilities_); + client_->Start(signaling_.get(), authenticator_.Pass(), transport_context, + host_jid_, capabilities_); } void ChromotingJniInstance::FetchSecret( |