summaryrefslogtreecommitdiffstats
path: root/remoting
diff options
context:
space:
mode:
authorsergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-05 20:49:23 +0000
committersergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-05 20:49:23 +0000
commit3cfca74ef66bbc17cc51dd6afdbb4763aefbd215 (patch)
treeefc9029423a3f738c0ad9210a34fa1dd8dd6003b /remoting
parent583335e29fb77b9a18f43c6804b8bfcd1b3f1d52 (diff)
downloadchromium_src-3cfca74ef66bbc17cc51dd6afdbb4763aefbd215.zip
chromium_src-3cfca74ef66bbc17cc51dd6afdbb4763aefbd215.tar.gz
chromium_src-3cfca74ef66bbc17cc51dd6afdbb4763aefbd215.tar.bz2
Removed dependence on remoting/client from remoting/protocol.
Reenable commented targets in remoting.gyp BUG=None TEST=compiles Review URL: http://codereview.chromium.org/4558001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65248 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting')
-rw-r--r--remoting/client/chromoting_client.cc3
-rw-r--r--remoting/client/plugin/chromoting_instance.cc6
-rw-r--r--remoting/client/plugin/chromoting_instance.h2
-rw-r--r--remoting/client/x11_client.cc5
-rw-r--r--remoting/protocol/connection_to_host.h13
-rw-r--r--remoting/protocol/jingle_connection_to_host.cc23
-rw-r--r--remoting/protocol/jingle_connection_to_host.h13
-rw-r--r--remoting/remoting.gyp54
8 files changed, 67 insertions, 52 deletions
diff --git a/remoting/client/chromoting_client.cc b/remoting/client/chromoting_client.cc
index ce3cedc..4400d4f 100644
--- a/remoting/client/chromoting_client.cc
+++ b/remoting/client/chromoting_client.cc
@@ -44,7 +44,8 @@ void ChromotingClient::Start() {
return;
}
- connection_->Connect(config_, this, this);
+ connection_->Connect(config_.username, config_.auth_token, config_.host_jid,
+ this, this);
if (!view_->Initialize()) {
ClientDone();
diff --git a/remoting/client/plugin/chromoting_instance.cc b/remoting/client/plugin/chromoting_instance.cc
index 20f2147..c5d1182 100644
--- a/remoting/client/plugin/chromoting_instance.cc
+++ b/remoting/client/plugin/chromoting_instance.cc
@@ -67,11 +67,13 @@ bool ChromotingInstance::Init(uint32_t argc,
context_.Start();
// Create the chromoting objects.
- host_connection_.reset(new protocol::JingleConnectionToHost(&context_));
+ host_connection_.reset(new protocol::JingleConnectionToHost(
+ context_.jingle_thread()));
view_.reset(new PepperView(this, &context_));
rectangle_decoder_.reset(
new RectangleUpdateDecoder(context_.decode_message_loop(), view_.get()));
- input_handler_.reset(new PepperInputHandler(&context_, host_connection_.get(),
+ input_handler_.reset(new PepperInputHandler(&context_,
+ host_connection_.get(),
view_.get()));
// Default to a medium grey.
diff --git a/remoting/client/plugin/chromoting_instance.h b/remoting/client/plugin/chromoting_instance.h
index 29a3bbf..ead3b56 100644
--- a/remoting/client/plugin/chromoting_instance.h
+++ b/remoting/client/plugin/chromoting_instance.h
@@ -45,6 +45,8 @@ class JingleThread;
class PepperView;
class RectangleUpdateDecoder;
+struct ClientConfig;
+
namespace protocol {
class HostConnection;
} // namespace protocol
diff --git a/remoting/client/x11_client.cc b/remoting/client/x11_client.cc
index 77158d78..8927610 100644
--- a/remoting/client/x11_client.cc
+++ b/remoting/client/x11_client.cc
@@ -7,8 +7,10 @@
#include <iostream>
#include "base/at_exit.h"
+#include "base/message_loop.h"
#include "remoting/client/chromoting_client.h"
#include "remoting/client/client_config.h"
+#include "remoting/client/client_context.h"
#include "remoting/client/client_util.h"
#include "remoting/client/rectangle_update_decoder.h"
#include "remoting/client/x11_view.h"
@@ -30,7 +32,8 @@ int main(int argc, char** argv) {
MessageLoop ui_loop;
remoting::ClientContext context;
- remoting::protocol::JingleConnectionToHost connection(&context);
+ remoting::protocol::JingleConnectionToHost connection(
+ context.jingle_thread());
remoting::X11View view;
remoting::RectangleUpdateDecoder rectangle_decoder(
context.decode_message_loop(), &view);
diff --git a/remoting/protocol/connection_to_host.h b/remoting/protocol/connection_to_host.h
index 7905c18..39aeecd 100644
--- a/remoting/protocol/connection_to_host.h
+++ b/remoting/protocol/connection_to_host.h
@@ -5,15 +5,14 @@
#ifndef REMOTING_PROTOCOL_CONNECTION_TO_HOST_H_
#define REMOTING_PROTOCOL_CONNECTION_TO_HOST_H_
+#include <string>
+
#include "base/ref_counted.h"
#include "base/scoped_ptr.h"
#include "remoting/proto/internal.pb.h"
#include "remoting/protocol/message_decoder.h"
namespace remoting {
-
-struct ClientConfig;
-
namespace protocol {
class VideoStub;
@@ -24,8 +23,8 @@ class ConnectionToHost {
public:
virtual ~HostEventCallback() {}
- // Handles an event received by the protocol::ConnectionToHost. Ownership of
- // the message is passed to the callee.
+ // Handles an event received by the protocol::ConnectionToHost. Ownership
+ // of the message is passed to the callee.
virtual void HandleMessage(ConnectionToHost* conn,
ChromotingHostMessage* message) = 0;
@@ -42,7 +41,9 @@ class ConnectionToHost {
virtual ~ConnectionToHost() {}
// TODO(ajwong): We need to generalize this API.
- virtual void Connect(const ClientConfig& config,
+ virtual void Connect(const std::string& username,
+ const std::string& auth_token,
+ const std::string& host_jid,
HostEventCallback* event_callback,
VideoStub* video_stub) = 0;
virtual void Disconnect() = 0;
diff --git a/remoting/protocol/jingle_connection_to_host.cc b/remoting/protocol/jingle_connection_to_host.cc
index e76184e..ec73780 100644
--- a/remoting/protocol/jingle_connection_to_host.cc
+++ b/remoting/protocol/jingle_connection_to_host.cc
@@ -9,7 +9,6 @@
#include "remoting/base/constants.h"
// TODO(hclam): Remove this header once MessageDispatcher is used.
#include "remoting/base/multiple_array_input_stream.h"
-#include "remoting/client/client_config.h"
#include "remoting/jingle_glue/jingle_thread.h"
#include "remoting/protocol/jingle_session_manager.h"
#include "remoting/protocol/video_reader.h"
@@ -19,28 +18,30 @@
namespace remoting {
namespace protocol {
-JingleConnectionToHost::JingleConnectionToHost(ClientContext* context)
- : context_(context),
+JingleConnectionToHost::JingleConnectionToHost(JingleThread* thread)
+ : thread_(thread),
event_callback_(NULL) {
}
JingleConnectionToHost::~JingleConnectionToHost() {
}
-void JingleConnectionToHost::Connect(const ClientConfig& config,
- HostEventCallback* event_callback,
- VideoStub* video_stub) {
+void JingleConnectionToHost::Connect(const std::string& username,
+ const std::string& auth_token,
+ const std::string& host_jid,
+ HostEventCallback* event_callback,
+ VideoStub* video_stub) {
event_callback_ = event_callback;
video_stub_ = video_stub;
// Initialize |jingle_client_|.
- jingle_client_ = new JingleClient(context_->jingle_thread());
- jingle_client_->Init(config.username, config.auth_token,
+ jingle_client_ = new JingleClient(thread_);
+ jingle_client_->Init(username, auth_token,
kChromotingTokenServiceName, this);
// Save jid of the host. The actual connection is created later after
// |jingle_client_| is connected.
- host_jid_ = config.host_jid;
+ host_jid_ = host_jid;
}
void JingleConnectionToHost::Disconnect() {
@@ -72,7 +73,7 @@ void JingleConnectionToHost::InitSession() {
// Initialize chromotocol |session_manager_|.
protocol::JingleSessionManager* session_manager =
- new protocol::JingleSessionManager(context_->jingle_thread());
+ new protocol::JingleSessionManager(thread_);
// TODO(ajwong): Make this a command switch when we're more stable.
session_manager->set_allow_local_ips(true);
session_manager->Init(
@@ -171,7 +172,7 @@ void JingleConnectionToHost::OnSessionStateChange(
}
MessageLoop* JingleConnectionToHost::message_loop() {
- return context_->jingle_thread()->message_loop();
+ return thread_->message_loop();
}
} // namespace protocol
diff --git a/remoting/protocol/jingle_connection_to_host.h b/remoting/protocol/jingle_connection_to_host.h
index 931b5b3..fe56e95 100644
--- a/remoting/protocol/jingle_connection_to_host.h
+++ b/remoting/protocol/jingle_connection_to_host.h
@@ -22,7 +22,6 @@
#include "base/ref_counted.h"
#include "base/scoped_ptr.h"
#include "base/task.h"
-#include "remoting/client/client_context.h"
#include "remoting/jingle_glue/jingle_client.h"
#include "remoting/protocol/connection_to_host.h"
#include "remoting/protocol/message_reader.h"
@@ -33,6 +32,9 @@
class MessageLoop;
namespace remoting {
+
+class JingleThread;
+
namespace protocol {
class VideoReader;
@@ -41,10 +43,13 @@ class VideoStub;
class JingleConnectionToHost : public ConnectionToHost,
public JingleClient::Callback {
public:
- explicit JingleConnectionToHost(ClientContext* context);
+ // TODO(sergeyu): Constructor shouldn't need thread here.
+ explicit JingleConnectionToHost(JingleThread* thread);
virtual ~JingleConnectionToHost();
- virtual void Connect(const ClientConfig& config,
+ virtual void Connect(const std::string& username,
+ const std::string& auth_token,
+ const std::string& host_jid,
HostEventCallback* event_callback,
VideoStub* video_stub);
virtual void Disconnect();
@@ -81,7 +86,7 @@ class JingleConnectionToHost : public ConnectionToHost,
void OnDisconnected();
void OnServerClosed();
- ClientContext* context_;
+ JingleThread* thread_;
scoped_refptr<JingleClient> jingle_client_;
scoped_refptr<protocol::SessionManager> session_manager_;
diff --git a/remoting/remoting.gyp b/remoting/remoting.gyp
index d651037..f2d962b 100644
--- a/remoting/remoting.gyp
+++ b/remoting/remoting.gyp
@@ -276,22 +276,22 @@
],
}, # end of target 'chromoting_client'
- #{
- # 'target_name': 'chromoting_simple_host',
- # 'type': 'executable',
- # 'dependencies': [
- # 'chromoting_base',
- # 'chromoting_host',
- # 'chromoting_jingle_glue',
- # '../base/base.gyp:base',
- # '../base/base.gyp:base_i18n',
- # ],
- # 'sources': [
- # 'host/capturer_fake_ascii.cc',
- # 'host/capturer_fake_ascii.h',
- # 'host/simple_host_process.cc',
- # ],
- #}, # end of target 'chromoting_simple_host'
+ {
+ 'target_name': 'chromoting_simple_host',
+ 'type': 'executable',
+ 'dependencies': [
+ 'chromoting_base',
+ 'chromoting_host',
+ 'chromoting_jingle_glue',
+ '../base/base.gyp:base',
+ '../base/base.gyp:base_i18n',
+ ],
+ 'sources': [
+ 'host/capturer_fake_ascii.cc',
+ 'host/capturer_fake_ascii.h',
+ 'host/simple_host_process.cc',
+ ],
+ }, # end of target 'chromoting_simple_host'
{
'target_name': 'chromoting_host_keygen',
@@ -410,17 +410,17 @@
],
}, # end of target 'chromoting_protocol'
- #{
- # 'target_name': 'chromotocol_test_client',
- # 'type': 'executable',
- # 'dependencies': [
- # 'chromoting_base',
- # 'chromoting_protocol',
- # ],
- # 'sources': [
- # 'protocol/protocol_test_client.cc',
- # ],
- #}, # end of target 'chromotocol_test_client'
+ {
+ 'target_name': 'chromotocol_test_client',
+ 'type': 'executable',
+ 'dependencies': [
+ 'chromoting_base',
+ 'chromoting_protocol',
+ ],
+ 'sources': [
+ 'protocol/protocol_test_client.cc',
+ ],
+ }, # end of target 'chromotocol_test_client'
# Remoting unit tests
{