summaryrefslogtreecommitdiffstats
path: root/remoting/protocol
diff options
context:
space:
mode:
authorajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-07 17:19:17 +0000
committerajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-07 17:19:17 +0000
commit2db531074be20594b38f882448fa918996cd2abc (patch)
treef7ee240697eefcb53896ede6a01d46266554d190 /remoting/protocol
parenta2f2e479644f4073b00b66d5efc67789b12d1072 (diff)
downloadchromium_src-2db531074be20594b38f882448fa918996cd2abc.zip
chromium_src-2db531074be20594b38f882448fa918996cd2abc.tar.gz
chromium_src-2db531074be20594b38f882448fa918996cd2abc.tar.bz2
Wire up the codepath from Javascript into Jingle for IQ packets.
Flushes out XmppProxy, the thread-safe interface that matches up Pepper with Jingle and plumbs a ConnectSandboxed method through everything so that the connection type can be chosen at runtime. BUG=51198 TEST=Check that stanzas are sent/received from JS, and that xmpp still works. Review URL: http://codereview.chromium.org/6603036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@77148 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/protocol')
-rw-r--r--remoting/protocol/connection_to_host.cc35
-rw-r--r--remoting/protocol/connection_to_host.h7
2 files changed, 32 insertions, 10 deletions
diff --git a/remoting/protocol/connection_to_host.cc b/remoting/protocol/connection_to_host.cc
index 2ef3a22..cf65520 100644
--- a/remoting/protocol/connection_to_host.cc
+++ b/remoting/protocol/connection_to_host.cc
@@ -59,17 +59,32 @@ void ConnectionToHost::Connect(const std::string& username,
video_stub_ = video_stub;
// Initialize |jingle_client_|.
- if (1 == 0) {
- signal_strategy_.reset(new JavascriptSignalStrategy());
- } else {
- signal_strategy_.reset(
- new XmppSignalStrategy(thread_, username, auth_token,
- kChromotingTokenServiceName));
- }
+ signal_strategy_.reset(
+ new XmppSignalStrategy(thread_, username, auth_token,
+ kChromotingTokenServiceName));
+ jingle_client_ = new JingleClient(thread_, signal_strategy_.get(), this);
+ jingle_client_->Init();
- jingle_client_ = new JingleClient(thread_, signal_strategy_.get(),
- network_manager_.release(),
- socket_factory_.release(), this);
+ // Save jid of the host. The actual connection is created later after
+ // |jingle_client_| is connected.
+ host_jid_ = host_jid;
+}
+
+void ConnectionToHost::ConnectSandboxed(scoped_refptr<XmppProxy> xmpp_proxy,
+ const std::string& your_jid,
+ const std::string& host_jid,
+ HostEventCallback* event_callback,
+ ClientStub* client_stub,
+ VideoStub* video_stub) {
+ event_callback_ = event_callback;
+ client_stub_ = client_stub;
+ video_stub_ = video_stub;
+
+ // Initialize |jingle_client_|.
+ JavascriptSignalStrategy* strategy = new JavascriptSignalStrategy(your_jid);
+ strategy->AttachXmppProxy(xmpp_proxy);
+ signal_strategy_.reset(strategy);
+ jingle_client_ = new JingleClient(thread_, signal_strategy_.get(), this);
jingle_client_->Init();
// Save jid of the host. The actual connection is created later after
diff --git a/remoting/protocol/connection_to_host.h b/remoting/protocol/connection_to_host.h
index 3962c32..da91be9 100644
--- a/remoting/protocol/connection_to_host.h
+++ b/remoting/protocol/connection_to_host.h
@@ -24,6 +24,7 @@ class MessageLoop;
namespace remoting {
class JingleThread;
+class XmppProxy;
class VideoPacket;
namespace protocol {
@@ -66,6 +67,12 @@ class ConnectionToHost : public JingleClient::Callback {
HostEventCallback* event_callback,
ClientStub* client_stub,
VideoStub* video_stub);
+ virtual void ConnectSandboxed(scoped_refptr<XmppProxy> xmpp_proxy,
+ const std::string& your_jid,
+ const std::string& host_jid,
+ HostEventCallback* event_callback,
+ ClientStub* client_stub,
+ VideoStub* video_stub);
virtual void Disconnect();
virtual const SessionConfig* config();