OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 // ClipboardThreadProxy is used to allow a Clipboard on the UI thread to invoke | |
6 // a ClipboardStub on the network thread. | |
7 | |
8 #ifndef REMOTING_PROTOCOL_CLIPBOARD_THREAD_PROXY_H_ | |
9 #define REMOTING_PROTOCOL_CLIPBOARD_THREAD_PROXY_H_ | |
10 | |
11 #include "base/memory/weak_ptr.h" | |
12 #include "remoting/protocol/clipboard_stub.h" | |
13 | |
14 namespace base { | |
15 class MessageLoopProxy; | |
16 } // namespace base | |
17 | |
18 namespace remoting { | |
19 namespace protocol { | |
20 | |
21 class ClipboardThreadProxy : public ClipboardStub { | |
22 public: | |
23 ~ClipboardThreadProxy(); | |
Wez
2012/05/30 23:58:02
virtual
simonmorris
2012/05/31 00:21:18
Done.
| |
24 | |
25 // Constructs a proxy for |clipboard_stub| which will trampoline invocations | |
26 // to |clipboard_stub_message_loop|. | |
27 ClipboardThreadProxy( | |
28 const base::WeakPtr<ClipboardStub>& clipboard_stub, | |
29 scoped_refptr<base::MessageLoopProxy> clipboard_stub_message_loop); | |
Wez
2012/05/30 23:58:02
nit: We're moving to SingleThreadTaskRunner, which
simonmorris
2012/05/31 00:21:18
Done.
| |
30 | |
31 // ClipboardStub implementation. | |
32 virtual void InjectClipboardEvent(const ClipboardEvent& event) OVERRIDE; | |
33 | |
34 // Injects a clipboard event into a stub, if the given weak pointer to the | |
35 // stub is valid. | |
36 static void InjectClipboardEventStatic( | |
37 const base::WeakPtr<ClipboardStub>& clipboard_stub, | |
38 const ClipboardEvent& event); | |
Wez
2012/05/30 23:58:02
Make this private, since it's an internal implemen
simonmorris
2012/05/31 00:21:18
Done.
| |
39 | |
40 private: | |
41 base::WeakPtr<ClipboardStub> clipboard_stub_; | |
42 scoped_refptr<base::MessageLoopProxy> clipboard_stub_message_loop_; | |
Wez
2012/05/30 23:58:02
nit: These could be target_stub_ and target_messag
simonmorris
2012/05/31 00:21:18
I'd prefer to keep these names, for consistency wi
| |
43 | |
44 DISALLOW_COPY_AND_ASSIGN(ClipboardThreadProxy); | |
45 }; | |
46 | |
47 } // namespace protocol | |
48 } // namespace remoting | |
49 | |
50 #endif // REMOTING_PROTOCOL_CLIPBOARD_THREAD_PROXY_H_ | |
OLD | NEW |