summaryrefslogtreecommitdiffstats
path: root/remoting
diff options
context:
space:
mode:
authorsergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-14 17:56:58 +0000
committersergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-14 17:56:58 +0000
commit5555356e2feef59d49f51f28e88868d121689321 (patch)
tree20df29c84f8b0d962b4f6b8b3d4b717c669d0d5a /remoting
parent6a6a73caaa43485a6bb6738634a4c30bc3f8f484 (diff)
downloadchromium_src-5555356e2feef59d49f51f28e88868d121689321.zip
chromium_src-5555356e2feef59d49f51f28e88868d121689321.tar.gz
chromium_src-5555356e2feef59d49f51f28e88868d121689321.tar.bz2
Revert 136692 - Switch client to Pepper UDP API instead of Transport API.
BUG=109630 Review URL: https://chromiumcodereview.appspot.com/10284008 TBR=sergeyu@chromium.org Review URL: https://chromiumcodereview.appspot.com/10387113 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@136908 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting')
-rw-r--r--remoting/client/chromoting_client.cc9
-rw-r--r--remoting/client/chromoting_client.h7
-rw-r--r--remoting/client/plugin/chromoting_instance.cc14
-rw-r--r--remoting/client/plugin/pepper_packet_socket_factory.cc6
-rw-r--r--remoting/client/plugin/pepper_port_allocator.cc1
-rw-r--r--remoting/protocol/connection_to_host.cc7
-rw-r--r--remoting/protocol/connection_to_host.h4
7 files changed, 14 insertions, 34 deletions
diff --git a/remoting/client/chromoting_client.cc b/remoting/client/chromoting_client.cc
index 4dabdd2..723af04 100644
--- a/remoting/client/chromoting_client.cc
+++ b/remoting/client/chromoting_client.cc
@@ -13,7 +13,6 @@
#include "remoting/protocol/negotiating_authenticator.h"
#include "remoting/protocol/v1_authenticator.h"
#include "remoting/protocol/session_config.h"
-#include "remoting/protocol/transport.h"
namespace remoting {
@@ -47,9 +46,7 @@ ChromotingClient::ChromotingClient(const ClientConfig& config,
ChromotingClient::~ChromotingClient() {
}
-void ChromotingClient::Start(
- scoped_refptr<XmppProxy> xmpp_proxy,
- scoped_ptr<protocol::TransportFactory> transport_factory) {
+void ChromotingClient::Start(scoped_refptr<XmppProxy> xmpp_proxy) {
DCHECK(message_loop()->BelongsToCurrentThread());
scoped_ptr<protocol::Authenticator> authenticator;
@@ -63,8 +60,8 @@ void ChromotingClient::Start(
}
connection_->Connect(xmpp_proxy, config_.local_jid, config_.host_jid,
- config_.host_public_key, transport_factory.Pass(),
- authenticator.Pass(), this, this, this, this);
+ config_.host_public_key, authenticator.Pass(),
+ this, this, this, this);
if (!view_->Initialize()) {
ClientDone();
diff --git a/remoting/client/chromoting_client.h b/remoting/client/chromoting_client.h
index 765b523..7df0816 100644
--- a/remoting/client/chromoting_client.h
+++ b/remoting/client/chromoting_client.h
@@ -26,10 +26,6 @@ class MessageLoop;
namespace remoting {
-namespace protocol {
-class TransportFactory;
-} // namespace protocol
-
class ClientContext;
class RectangleUpdateDecoder;
@@ -48,8 +44,7 @@ class ChromotingClient : public protocol::ConnectionToHost::HostEventCallback,
const base::Closure& client_done);
virtual ~ChromotingClient();
- void Start(scoped_refptr<XmppProxy> xmpp_proxy,
- scoped_ptr<protocol::TransportFactory> transport_factory);
+ void Start(scoped_refptr<XmppProxy> xmpp_proxy);
void Stop(const base::Closure& shutdown_task);
void ClientDone();
diff --git a/remoting/client/plugin/chromoting_instance.cc b/remoting/client/plugin/chromoting_instance.cc
index c4d143f..d1b673f 100644
--- a/remoting/client/plugin/chromoting_instance.cc
+++ b/remoting/client/plugin/chromoting_instance.cc
@@ -19,7 +19,6 @@
#include "base/synchronization/waitable_event.h"
#include "base/threading/thread.h"
#include "base/values.h"
-#include "jingle/glue/thread_wrapper.h"
#include "media/base/media.h"
#include "ppapi/cpp/completion_callback.h"
#include "ppapi/cpp/input_event.h"
@@ -33,14 +32,12 @@
#include "remoting/client/frame_consumer_proxy.h"
#include "remoting/client/plugin/chromoting_scriptable_object.h"
#include "remoting/client/plugin/pepper_input_handler.h"
-#include "remoting/client/plugin/pepper_port_allocator.h"
#include "remoting/client/plugin/pepper_view.h"
#include "remoting/client/plugin/pepper_xmpp_proxy.h"
#include "remoting/client/rectangle_update_decoder.h"
#include "remoting/protocol/connection_to_host.h"
#include "remoting/protocol/host_stub.h"
#include "remoting/protocol/input_event_tracker.h"
-#include "remoting/protocol/libjingle_transport_factory.h"
#include "remoting/protocol/mouse_input_filter.h"
// Windows defines 'PostMessage', so we have to undef it.
@@ -399,10 +396,8 @@ ChromotingScriptableObject* ChromotingInstance::GetScriptableObject() {
void ChromotingInstance::Connect(const ClientConfig& config) {
DCHECK(plugin_message_loop_->BelongsToCurrentThread());
- jingle_glue::JingleThreadWrapper::EnsureForCurrentThread();
-
host_connection_.reset(new protocol::ConnectionToHost(
- context_.network_message_loop(), true));
+ context_.network_message_loop(), this, true));
client_.reset(new ChromotingClient(config, &context_, host_connection_.get(),
view_.get(), rectangle_decoder_.get(),
base::Closure()));
@@ -435,13 +430,8 @@ void ChromotingInstance::Connect(const ClientConfig& config) {
plugin_message_loop_,
context_.network_message_loop());
- scoped_ptr<cricket::HttpPortAllocatorBase> port_allocator(
- PepperPortAllocator::Create(this));
- scoped_ptr<protocol::TransportFactory> transport_factory(
- new protocol::LibjingleTransportFactory(port_allocator.Pass(), false));
-
// Kick off the connection.
- client_->Start(xmpp_proxy_, transport_factory.Pass());
+ client_->Start(xmpp_proxy_);
// Start timer that periodically sends perf stats.
plugin_message_loop_->PostDelayedTask(
diff --git a/remoting/client/plugin/pepper_packet_socket_factory.cc b/remoting/client/plugin/pepper_packet_socket_factory.cc
index e007351..b80102f 100644
--- a/remoting/client/plugin/pepper_packet_socket_factory.cc
+++ b/remoting/client/plugin/pepper_packet_socket_factory.cc
@@ -259,11 +259,7 @@ int UdpPacketSocket::Send(const void* data, size_t data_size) {
int UdpPacketSocket::SendTo(const void* data,
size_t data_size,
const talk_base::SocketAddress& address) {
- if (state_ != STATE_BOUND) {
- // TODO(sergeyu): StunPort may try to send stun request before we
- // are bound. Fix that problem and change this to DCHECK.
- return EINVAL;
- }
+ DCHECK_EQ(state_, STATE_BOUND);
if (error_ != 0) {
return error_;
diff --git a/remoting/client/plugin/pepper_port_allocator.cc b/remoting/client/plugin/pepper_port_allocator.cc
index 3c89655..e999f54 100644
--- a/remoting/client/plugin/pepper_port_allocator.cc
+++ b/remoting/client/plugin/pepper_port_allocator.cc
@@ -66,7 +66,6 @@ PepperPortAllocatorSession::PepperPortAllocatorSession(
: HttpPortAllocatorSessionBase(
allocator, channel_name, component, stun_hosts, relay_hosts, relay, ""),
instance_(instance) {
- set_flags(cricket::PORTALLOCATOR_DISABLE_TCP);
}
PepperPortAllocatorSession::~PepperPortAllocatorSession() {
diff --git a/remoting/protocol/connection_to_host.cc b/remoting/protocol/connection_to_host.cc
index 25a8949..802d010 100644
--- a/remoting/protocol/connection_to_host.cc
+++ b/remoting/protocol/connection_to_host.cc
@@ -29,8 +29,10 @@ namespace protocol {
ConnectionToHost::ConnectionToHost(
base::MessageLoopProxy* message_loop,
+ pp::Instance* pp_instance,
bool allow_nat_traversal)
: message_loop_(message_loop),
+ pp_instance_(pp_instance),
allow_nat_traversal_(allow_nat_traversal),
event_callback_(NULL),
client_stub_(NULL),
@@ -60,7 +62,6 @@ void ConnectionToHost::Connect(scoped_refptr<XmppProxy> xmpp_proxy,
const std::string& local_jid,
const std::string& host_jid,
const std::string& host_public_key,
- scoped_ptr<TransportFactory> transport_factory,
scoped_ptr<Authenticator> authenticator,
HostEventCallback* event_callback,
ClientStub* client_stub,
@@ -83,8 +84,10 @@ void ConnectionToHost::Connect(scoped_refptr<XmppProxy> xmpp_proxy,
signal_strategy_->AddListener(this);
signal_strategy_->Connect();
+ scoped_ptr<TransportFactory> transport_factory(
+ new PepperTransportFactory(pp_instance_));
session_manager_.reset(new JingleSessionManager(
- transport_factory.Pass(), allow_nat_traversal_));
+ transport_factory.Pass(), true));
session_manager_->Init(signal_strategy_.get(), this);
}
diff --git a/remoting/protocol/connection_to_host.h b/remoting/protocol/connection_to_host.h
index 9deb3b69..45e1f9a 100644
--- a/remoting/protocol/connection_to_host.h
+++ b/remoting/protocol/connection_to_host.h
@@ -42,7 +42,6 @@ class ClipboardStub;
class HostStub;
class InputStub;
class SessionConfig;
-class TransportFactory;
class VideoReader;
class VideoStub;
@@ -65,6 +64,7 @@ class ConnectionToHost : public SignalStrategy::Listener,
};
ConnectionToHost(base::MessageLoopProxy* message_loop,
+ pp::Instance* pp_instance,
bool allow_nat_traversal);
virtual ~ConnectionToHost();
@@ -72,7 +72,6 @@ class ConnectionToHost : public SignalStrategy::Listener,
const std::string& local_jid,
const std::string& host_jid,
const std::string& host_public_key,
- scoped_ptr<TransportFactory> transport_factory,
scoped_ptr<Authenticator> authenticator,
HostEventCallback* event_callback,
ClientStub* client_stub,
@@ -123,6 +122,7 @@ class ConnectionToHost : public SignalStrategy::Listener,
void SetState(State state, ErrorCode error);
scoped_refptr<base::MessageLoopProxy> message_loop_;
+ pp::Instance* pp_instance_;
bool allow_nat_traversal_;
std::string host_jid_;