summaryrefslogtreecommitdiffstats
path: root/remoting
diff options
context:
space:
mode:
authorsergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-04 21:56:51 +0000
committersergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-04 21:56:51 +0000
commit97c829370cf5d2a4679b18cb1a848074a17c3f1c (patch)
tree91271c552bbe6785d405054d6c725f0f72c565e3 /remoting
parenteb6ce67d73fb34b0ffae10904bd65bfff67f6c59 (diff)
downloadchromium_src-97c829370cf5d2a4679b18cb1a848074a17c3f1c.zip
chromium_src-97c829370cf5d2a4679b18cb1a848074a17c3f1c.tar.gz
chromium_src-97c829370cf5d2a4679b18cb1a848074a17c3f1c.tar.bz2
Don't use JingleThread in the client plugin.
TEST=client works with seccomp sandbox. BUG=None Review URL: http://codereview.chromium.org/7575016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@95511 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting')
-rw-r--r--remoting/client/DEPS1
-rw-r--r--remoting/client/chromoting_client.cc5
-rw-r--r--remoting/client/client_context.cc19
-rw-r--r--remoting/client/client_context.h10
-rw-r--r--remoting/client/plugin/chromoting_instance.cc3
5 files changed, 15 insertions, 23 deletions
diff --git a/remoting/client/DEPS b/remoting/client/DEPS
index fa11a6a..ab0c15a 100644
--- a/remoting/client/DEPS
+++ b/remoting/client/DEPS
@@ -1,5 +1,6 @@
include_rules = [
"+ppapi",
+ "+jingle/glue",
"+third_party/npapi",
"+ui/gfx",
diff --git a/remoting/client/chromoting_client.cc b/remoting/client/chromoting_client.cc
index 130e398..48b8a21 100644
--- a/remoting/client/chromoting_client.cc
+++ b/remoting/client/chromoting_client.cc
@@ -6,6 +6,7 @@
#include "base/bind.h"
#include "base/message_loop.h"
+#include "jingle/glue/thread_wrapper.h"
#include "remoting/base/tracer.h"
#include "remoting/client/chromoting_view.h"
#include "remoting/client/client_context.h"
@@ -46,6 +47,8 @@ void ChromotingClient::Start(scoped_refptr<XmppProxy> xmpp_proxy) {
return;
}
+ jingle_glue::JingleThreadWrapper::EnsureForCurrentThread();
+
connection_->Connect(xmpp_proxy, config_.local_jid, config_.host_jid,
config_.host_public_key, config_.access_code,
this, this, this);
@@ -180,7 +183,7 @@ void ChromotingClient::OnConnectionFailed(protocol::ConnectionToHost* conn) {
}
MessageLoop* ChromotingClient::message_loop() {
- return context_->jingle_thread()->message_loop();
+ return context_->network_message_loop();
}
void ChromotingClient::SetConnectionState(ConnectionState s) {
diff --git a/remoting/client/client_context.cc b/remoting/client/client_context.cc
index 5f6d139..4ad0fab 100644
--- a/remoting/client/client_context.cc
+++ b/remoting/client/client_context.cc
@@ -4,16 +4,12 @@
#include "remoting/client/client_context.h"
-#include <string>
-
-#include "base/threading/thread.h"
-#include "remoting/jingle_glue/jingle_thread.h"
-
namespace remoting {
ClientContext::ClientContext()
: main_thread_("ChromotingClientMainThread"),
- decode_thread_("ChromotingClientDecodeThread") {
+ decode_thread_("ChromotingClientDecodeThread"),
+ network_thread_("ChromotingClientNetworkThread") {
}
ClientContext::~ClientContext() {
@@ -23,20 +19,17 @@ void ClientContext::Start() {
// Start all the threads.
main_thread_.Start();
decode_thread_.Start();
- jingle_thread_.Start();
+ network_thread_.StartWithOptions(
+ base::Thread::Options(MessageLoop::TYPE_IO, 0));
}
void ClientContext::Stop() {
// Stop all the threads.
- jingle_thread_.Stop();
+ network_thread_.Stop();
decode_thread_.Stop();
main_thread_.Stop();
}
-JingleThread* ClientContext::jingle_thread() {
- return &jingle_thread_;
-}
-
MessageLoop* ClientContext::main_message_loop() {
return main_thread_.message_loop();
}
@@ -46,7 +39,7 @@ MessageLoop* ClientContext::decode_message_loop() {
}
MessageLoop* ClientContext::network_message_loop() {
- return jingle_thread_.message_loop();
+ return network_thread_.message_loop();
}
} // namespace remoting
diff --git a/remoting/client/client_context.h b/remoting/client/client_context.h
index 38c6088..e825d44 100644
--- a/remoting/client/client_context.h
+++ b/remoting/client/client_context.h
@@ -8,7 +8,6 @@
#include <string>
#include "base/threading/thread.h"
-#include "remoting/jingle_glue/jingle_thread.h"
namespace remoting {
@@ -22,17 +21,11 @@ class ClientContext {
void Start();
void Stop();
- JingleThread* jingle_thread();
-
MessageLoop* main_message_loop();
MessageLoop* decode_message_loop();
MessageLoop* network_message_loop();
private:
- // A thread that handles Jingle network operations (used in
- // JingleHostConnection).
- JingleThread jingle_thread_;
-
// A thread that handles capture rate control and sending data to the
// HostConnection.
base::Thread main_thread_;
@@ -40,6 +33,9 @@ class ClientContext {
// A thread that handles all decode operations.
base::Thread decode_thread_;
+ // A thread that handles all network IO.
+ base::Thread network_thread_;
+
DISALLOW_COPY_AND_ASSIGN(ClientContext);
};
diff --git a/remoting/client/plugin/chromoting_instance.cc b/remoting/client/plugin/chromoting_instance.cc
index 7429b4f..efc5e78 100644
--- a/remoting/client/plugin/chromoting_instance.cc
+++ b/remoting/client/plugin/chromoting_instance.cc
@@ -40,7 +40,6 @@
#include "remoting/client/plugin/pepper_view_proxy.h"
#include "remoting/client/plugin/pepper_util.h"
#include "remoting/client/plugin/pepper_xmpp_proxy.h"
-#include "remoting/jingle_glue/jingle_thread.h"
#include "remoting/proto/auth.pb.h"
#include "remoting/protocol/connection_to_host.h"
#include "remoting/protocol/host_stub.h"
@@ -209,7 +208,7 @@ void ChromotingInstance::Connect(const ClientConfig& config) {
ChromotingScriptableObject* scriptable_object = GetScriptableObject();
scoped_refptr<PepperXmppProxy> xmpp_proxy =
new PepperXmppProxy(scriptable_object->AsWeakPtr(),
- context_.jingle_thread()->message_loop());
+ context_.network_message_loop());
scriptable_object->AttachXmppProxy(xmpp_proxy);
// Kick off the connection.