Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(446)

Side by Side Diff: remoting/host/local_input_monitor_thread_linux.h

Issue 8775021: Fix race condition disconnecting hosts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use scoped_refptr instead of synchronization. Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef LOCAL_INPUT_MONITOR_THREAD_LINUX_H_ 5 #ifndef LOCAL_INPUT_MONITOR_THREAD_LINUX_H_
6 #define LOCAL_INPUT_MONITOR_THREAD_LINUX_H_ 6 #define LOCAL_INPUT_MONITOR_THREAD_LINUX_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/memory/ref_counted.h"
9 #include "base/threading/simple_thread.h" 10 #include "base/threading/simple_thread.h"
10 #include "third_party/skia/include/core/SkPoint.h" 11 #include "third_party/skia/include/core/SkPoint.h"
11 12
12 typedef struct _XDisplay Display; 13 typedef struct _XDisplay Display;
13 14
14 namespace remoting { 15 namespace remoting {
15 16
16 class ChromotingHost; 17 class ChromotingHost;
17 18
18 class LocalInputMonitorThread : public base::SimpleThread { 19 class LocalInputMonitorThread : public base::SimpleThread {
19 public: 20 public:
20 explicit LocalInputMonitorThread(ChromotingHost* host); 21 explicit LocalInputMonitorThread(ChromotingHost* host);
21 virtual ~LocalInputMonitorThread(); 22 virtual ~LocalInputMonitorThread();
22 23
23 void Stop(); 24 void Stop();
24 virtual void Run() OVERRIDE; 25 virtual void Run() OVERRIDE;
25 26
26 void LocalMouseMoved(const SkIPoint& pos); 27 void LocalMouseMoved(const SkIPoint& pos);
27 void LocalKeyPressed(int key_code, bool down); 28 void LocalKeyPressed(int key_code, bool down);
28 29
29 private: 30 private:
30 ChromotingHost* host_; 31 scoped_refptr<ChromotingHost> host_;
31 int wakeup_pipe_[2]; 32 int wakeup_pipe_[2];
32 Display* display_; 33 Display* display_;
33 bool alt_pressed_; 34 bool alt_pressed_;
34 bool ctrl_pressed_; 35 bool ctrl_pressed_;
35 36
36 DISALLOW_COPY_AND_ASSIGN(LocalInputMonitorThread); 37 DISALLOW_COPY_AND_ASSIGN(LocalInputMonitorThread);
37 }; 38 };
38 39
39 } // namespace remoting 40 } // namespace remoting
40 41
41 #endif 42 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698