summaryrefslogtreecommitdiffstats
path: root/remoting/client/jni
diff options
context:
space:
mode:
authorsergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-12 21:18:14 +0000
committersergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-12 21:18:14 +0000
commit09c190458e7149f69de20eb8f4a7b4f37f44298b (patch)
tree0d2f7d20540188a490a1d6f27d074364d22f27c0 /remoting/client/jni
parent874d7c748ec57b269fb1ceebfff00c8055320855 (diff)
downloadchromium_src-09c190458e7149f69de20eb8f4a7b4f37f44298b.zip
chromium_src-09c190458e7149f69de20eb8f4a7b4f37f44298b.tar.gz
chromium_src-09c190458e7149f69de20eb8f4a7b4f37f44298b.tar.bz2
Cleanup LibjingleTransportFactory
Removed dependency on ChromiumSocketFactory and ChromiumNetworkManager in LibjingleTransportFactory. It's necessary to compile this code for NaCl. BUG=276739 Review URL: https://codereview.chromium.org/109393004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@240416 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/client/jni')
-rw-r--r--remoting/client/jni/chromoting_jni_instance.cc21
-rw-r--r--remoting/client/jni/chromoting_jni_instance.h2
2 files changed, 14 insertions, 9 deletions
diff --git a/remoting/client/jni/chromoting_jni_instance.cc b/remoting/client/jni/chromoting_jni_instance.cc
index 59b9d38..339cea8 100644
--- a/remoting/client/jni/chromoting_jni_instance.cc
+++ b/remoting/client/jni/chromoting_jni_instance.cc
@@ -12,6 +12,9 @@
#include "remoting/client/audio_player.h"
#include "remoting/client/jni/android_keymap.h"
#include "remoting/client/jni/chromoting_jni_runtime.h"
+#include "remoting/jingle_glue/chromium_port_allocator.h"
+#include "remoting/jingle_glue/chromium_socket_factory.h"
+#include "remoting/jingle_glue/network_settings.h"
#include "remoting/protocol/host_stub.h"
#include "remoting/protocol/libjingle_transport_factory.h"
@@ -297,14 +300,18 @@ void ChromotingJniInstance::ConnectToHostOnNetworkThread() {
net::ClientSocketFactory::GetDefaultFactory(),
jni_runtime_->url_requester(), xmpp_config_));
- network_settings_.reset(new NetworkSettings(
- NetworkSettings::NAT_TRAVERSAL_ENABLED));
- scoped_ptr<protocol::TransportFactory> fact(
- protocol::LibjingleTransportFactory::Create(
- *network_settings_,
- jni_runtime_->url_requester()));
+ NetworkSettings network_settings(NetworkSettings::NAT_TRAVERSAL_ENABLED);
- client_->Start(signaling_.get(), fact.Pass());
+ // Use Chrome's network stack to allocate ports for peer-to-peer channels.
+ scoped_ptr<ChromiumPortAllocator> port_allocator(
+ ChromiumPortAllocator::Create(jni_runtime_->url_requester(),
+ network_settings));
+
+ scoped_ptr<protocol::TransportFactory> transport_factory(
+ new protocol::LibjingleTransportFactory(
+ port_allocator.PassAs<cricket::HttpPortAllocatorBase>(), false));
+
+ client_->Start(signaling_.get(), transport_factory.Pass());
}
void ChromotingJniInstance::DisconnectFromHostOnNetworkThread() {
diff --git a/remoting/client/jni/chromoting_jni_instance.h b/remoting/client/jni/chromoting_jni_instance.h
index db409f6..2d80b24 100644
--- a/remoting/client/jni/chromoting_jni_instance.h
+++ b/remoting/client/jni/chromoting_jni_instance.h
@@ -17,7 +17,6 @@
#include "remoting/client/client_user_interface.h"
#include "remoting/client/frame_consumer_proxy.h"
#include "remoting/client/jni/jni_frame_consumer.h"
-#include "remoting/jingle_glue/network_settings.h"
#include "remoting/jingle_glue/xmpp_signal_strategy.h"
#include "remoting/protocol/clipboard_stub.h"
#include "remoting/protocol/connection_to_host.h"
@@ -139,7 +138,6 @@ class ChromotingJniInstance
scoped_ptr<ChromotingClient> client_;
XmppSignalStrategy::XmppServerConfig xmpp_config_;
scoped_ptr<XmppSignalStrategy> signaling_; // Must outlive client_
- scoped_ptr<NetworkSettings> network_settings_;
// Pass this the user's PIN once we have it. To be assigned and accessed on
// the UI thread, but must be posted to the network thread to call it.