summaryrefslogtreecommitdiffstats
path: root/remoting/client/x11_client.cc
diff options
context:
space:
mode:
authorajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-17 17:06:32 +0000
committerajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-17 17:06:32 +0000
commitfc232b598c601e066f6a17b5c647b1e30667f38e (patch)
treebc7bb8d459caaed60ddc882d9aa66caa4bedacd0 /remoting/client/x11_client.cc
parentc1e0696a17d2683b191ebc9b3b5233260c12c3db (diff)
downloadchromium_src-fc232b598c601e066f6a17b5c647b1e30667f38e.zip
chromium_src-fc232b598c601e066f6a17b5c647b1e30667f38e.tar.gz
chromium_src-fc232b598c601e066f6a17b5c647b1e30667f38e.tar.bz2
Hookup the ChromotingPlugin into the refactored implementation
of HostConnection and ChromotingView. Also implement a bare-bones PepperView. No unittests yet. Still too in flux to be worth it. BUG=none TEST=none Review URL: http://codereview.chromium.org/2852003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50116 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/client/x11_client.cc')
-rw-r--r--remoting/client/x11_client.cc23
1 files changed, 11 insertions, 12 deletions
diff --git a/remoting/client/x11_client.cc b/remoting/client/x11_client.cc
index 11b0ebf..4b111e9 100644
--- a/remoting/client/x11_client.cc
+++ b/remoting/client/x11_client.cc
@@ -28,8 +28,7 @@ using remoting::JingleThread;
namespace remoting {
-class X11Client : public base::RefCountedThreadSafe<X11Client>,
- public HostConnection::HostEventCallback {
+class X11Client : public HostConnection::HostEventCallback {
public:
X11Client(MessageLoop* loop, base::WaitableEvent* client_done)
: message_loop_(loop),
@@ -145,7 +144,7 @@ class X11Client : public base::RefCountedThreadSafe<X11Client>,
XResizeWindow(display_, window_, width_, height_);
// Now construct the X11View that renders the remote desktop.
- view_ = new X11View(display_, window_, width_, height_);
+ view_.reset(new X11View(display_, window_, width_, height_));
// Schedule the event handler to process the event queue of X11.
ScheduleX11EventHandler();
@@ -215,13 +214,15 @@ class X11Client : public base::RefCountedThreadSafe<X11Client>,
int width_;
int height_;
- scoped_refptr<ChromotingView> view_;
+ scoped_ptr<ChromotingView> view_;
DISALLOW_COPY_AND_ASSIGN(X11Client);
};
} // namespace remoting
+DISABLE_RUNNABLE_METHOD_REFCOUNT(remoting::X11Client);
+
int main(int argc, char** argv) {
base::AtExitManager at_exit;
std::string host_jid;
@@ -237,20 +238,18 @@ int main(int argc, char** argv) {
network_thread.Start();
base::WaitableEvent client_done(false, false);
- scoped_refptr<remoting::X11Client> client =
- new remoting::X11Client(network_thread.message_loop(), &client_done);
- scoped_refptr<JingleHostConnection> connection =
- new JingleHostConnection(&network_thread, client);
- connection->Connect(username, auth_token, host_jid);
+ remoting::X11Client client(network_thread.message_loop(), &client_done);
+ JingleHostConnection connection(&network_thread);
+ connection.Connect(username, auth_token, host_jid, &client);
- client->InitX11();
+ client.InitX11();
// Wait until the main loop is done.
client_done.Wait();
- connection->Disconnect();
+ connection.Disconnect();
- client->DestroyX11();
+ client.DestroyX11();
// Quit the current message loop.
network_thread.message_loop()->PostTask(FROM_HERE,