summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-11 00:39:00 +0000
committerhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-11 00:39:00 +0000
commitc0bac53df6ffdd2bf29a8ec561429dfdd9ff39f5 (patch)
tree6fc56f8e45362ea47bdadabf68e05577de327d1b
parentf172b98916ab59ae666ebda2c94d1cb2fc542f01 (diff)
downloadchromium_src-c0bac53df6ffdd2bf29a8ec561429dfdd9ff39f5.zip
chromium_src-c0bac53df6ffdd2bf29a8ec561429dfdd9ff39f5.tar.gz
chromium_src-c0bac53df6ffdd2bf29a8ec561429dfdd9ff39f5.tar.bz2
Enable chromoting in the build by default
Set chromoting to be built by default. Also defines a ENABLE_CHROMOTING flag if chromoting is enabled in the build system so we can exclude chromoting if we don't want chromoting code to be linked in. Review URL: http://codereview.chromium.org/2788003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49482 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--build/common.gypi7
-rw-r--r--remoting/chromoting.gyp3
-rw-r--r--remoting/client/x11_client.cc13
-rw-r--r--remoting/client/x11_view.cc4
-rw-r--r--remoting/client/x11_view.h7
5 files changed, 22 insertions, 12 deletions
diff --git a/build/common.gypi b/build/common.gypi
index 0276b10..07f0614 100644
--- a/build/common.gypi
+++ b/build/common.gypi
@@ -110,8 +110,8 @@
# On Linux, we build with sse2 for Chromium builds.
'disable_sse2%': 0,
- # Chromoting compilation is disabled by default. Set to 1 to enable.
- 'chromoting%': 0,
+ # Chromoting compilation is enabled by default. Set to 0 to disable.
+ 'chromoting%': 1,
},
# Define branding and buildtype on the basis of their settings within the
@@ -408,6 +408,9 @@
['chromeos==1', {
'defines': ['OS_CHROMEOS=1'],
}],
+ ['chromoting==1', {
+ 'defines': ['ENABLE_CHROMOTING=1'],
+ }],
['proprietary_codecs==1', {
'defines': ['USE_PROPRIETARY_CODECS'],
}],
diff --git a/remoting/chromoting.gyp b/remoting/chromoting.gyp
index 1ef15e7..1084656 100644
--- a/remoting/chromoting.gyp
+++ b/remoting/chromoting.gyp
@@ -91,7 +91,8 @@
], # end of Client targets
}], # end of OS conditions for Client targets
- ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="mac"', {
+ # TODO(hclam): Enable this target for mac.
+ ['OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
'targets': [
{
'target_name': 'chromoting_x11_client',
diff --git a/remoting/client/x11_client.cc b/remoting/client/x11_client.cc
index 6b8e4e2..0e771a6 100644
--- a/remoting/client/x11_client.cc
+++ b/remoting/client/x11_client.cc
@@ -9,8 +9,9 @@
#include "base/at_exit.h"
#include "base/message_loop.h"
#include "base/stl_util-inl.h"
-#include "remoting/client/host_connection.h"
+#include "remoting/client/jingle_host_connection.h"
#include "remoting/client/client_util.h"
+#include "remoting/jingle_glue/jingle_thread.h"
// Include Xlib at the end because it clashes with ClientMessage defined in
// the protocol buffer.
@@ -22,7 +23,7 @@
namespace remoting {
class X11Client : public base::RefCountedThreadSafe<X11Client>,
- public HostConnection::EventHandler {
+ public HostConnection::HostEventCallback {
public:
X11Client(std::string host_jid, std::string username, std::string auth_token)
: display_(NULL),
@@ -42,11 +43,14 @@ class X11Client : public base::RefCountedThreadSafe<X11Client>,
// Starts the remoting client and the message loop. Returns only after
// the message loop has terminated.
void Run() {
+ // TODO(hclam): Fix the threading issue.
+ network_thread_.Start();
message_loop_.PostTask(FROM_HERE,
NewRunnableMethod(this, &X11Client::DoInitX11));
message_loop_.PostTask(FROM_HERE,
NewRunnableMethod(this, &X11Client::DoInitConnection));
message_loop_.Run();
+ network_thread_.Stop();
}
////////////////////////////////////////////////////////////////////////////
@@ -122,7 +126,7 @@ class X11Client : public base::RefCountedThreadSafe<X11Client>,
// Creates a HostConnection object and connection to the host.
LOG(INFO) << "Connecting...";
- connection_.reset(new HostConnection(new ProtocolDecoder(), this));
+ connection_.reset(new JingleHostConnection(&network_thread_, this));
connection_->Connect(username_, auth_token_, host_jid_);
}
@@ -240,6 +244,7 @@ class X11Client : public base::RefCountedThreadSafe<X11Client>,
scoped_ptr<HostConnection> connection_;
scoped_refptr<ChromotingView> view_;
+ JingleThread network_thread_;
MessageLoop message_loop_;
DISALLOW_COPY_AND_ASSIGN(X11Client);
@@ -251,7 +256,7 @@ int main() {
base::AtExitManager at_exit;
std::string host_jid, username, auth_token;
- if (!remoting::GetLoginInfo(host_jid, username, auth_token)) {
+ if (!remoting::GetLoginInfo(&host_jid, &username, &auth_token)) {
std::cout << "Cannot obtain login info" << std::endl;
return 1;
}
diff --git a/remoting/client/x11_view.cc b/remoting/client/x11_view.cc
index bdb54d4..170a8fa 100644
--- a/remoting/client/x11_view.cc
+++ b/remoting/client/x11_view.cc
@@ -12,7 +12,7 @@
namespace remoting {
-X11View::X11View(Display* display, int window, int width, int height)
+X11View::X11View(Display* display, XID window, int width, int height)
: display_(display),
window_(window),
picture_(0),
@@ -60,7 +60,7 @@ void X11View::Paint() {
XFreeGC(display_, gc);
// Creates the picture representing the pixmap.
- unsigned long picture = XRenderCreatePicture(
+ XID picture = XRenderCreatePicture(
display_, pixmap,
XRenderFindStandardFormat(display_, PictStandardARGB32),
0, NULL);
diff --git a/remoting/client/x11_view.h b/remoting/client/x11_view.h
index 1959e18..f6f8a3d 100644
--- a/remoting/client/x11_view.h
+++ b/remoting/client/x11_view.h
@@ -11,6 +11,7 @@
#include "remoting/client/decoder.h"
#include "remoting/client/chromoting_view.h"
+typedef unsigned long XID;
typedef struct _XDisplay Display;
namespace remoting {
@@ -18,7 +19,7 @@ namespace remoting {
// A ChromotingView implemented using X11 and XRender.
class X11View : public ChromotingView {
public:
- X11View(Display* display, int window, int width, int height);
+ X11View(Display* display, XID window, int width, int height);
virtual ~X11View();
@@ -34,13 +35,13 @@ class X11View : public ChromotingView {
void OnDecodeDone();
Display* display_;
- int window_;
+ XID window_;
int width_;
int height_;
// A picture created in the X server that represents drawing area of the
// window.
- int picture_;
+ XID picture_;
scoped_refptr<media::VideoFrame> frame_;
UpdatedRects update_rects_;