OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 PPAPI_PROXY_PROXY_CHANNEL_H_ | 5 #ifndef PPAPI_PROXY_PROXY_CHANNEL_H_ |
6 #define PPAPI_PROXY_PROXY_CHANNEL_H_ | 6 #define PPAPI_PROXY_PROXY_CHANNEL_H_ |
7 | 7 |
8 #include "base/files/scoped_file.h" | 8 #include "base/files/scoped_file.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/process/process.h" | 10 #include "base/process/process.h" |
11 #include "ipc/ipc_listener.h" | 11 #include "ipc/ipc_listener.h" |
12 #include "ipc/ipc_platform_file.h" | 12 #include "ipc/ipc_platform_file.h" |
13 #include "ipc/ipc_sender.h" | 13 #include "ipc/ipc_sender.h" |
14 #include "ipc/ipc_sync_channel.h" | 14 #include "ipc/ipc_sync_channel.h" |
15 #include "ppapi/proxy/ppapi_proxy_export.h" | 15 #include "ppapi/proxy/ppapi_proxy_export.h" |
16 | 16 |
17 namespace base { | 17 namespace base { |
18 class MessageLoopProxy; | 18 class SingleThreadTaskRunner; |
19 class WaitableEvent; | 19 class WaitableEvent; |
20 } | 20 } |
21 | 21 |
22 namespace IPC { | 22 namespace IPC { |
23 class TestSink; | 23 class TestSink; |
24 } | 24 } |
25 | 25 |
26 namespace ppapi { | 26 namespace ppapi { |
27 namespace proxy { | 27 namespace proxy { |
28 | 28 |
29 class PPAPI_PROXY_EXPORT ProxyChannel | 29 class PPAPI_PROXY_EXPORT ProxyChannel |
30 : public IPC::Listener, | 30 : public IPC::Listener, |
31 public IPC::Sender { | 31 public IPC::Sender { |
32 public: | 32 public: |
33 class PPAPI_PROXY_EXPORT Delegate { | 33 class PPAPI_PROXY_EXPORT Delegate { |
34 public: | 34 public: |
35 virtual ~Delegate() {} | 35 virtual ~Delegate() {} |
36 | 36 |
37 // Returns the dedicated message loop for processing IPC requests. | 37 // Returns the task runner for processing IPC requests. |
38 virtual base::MessageLoopProxy* GetIPCMessageLoop() = 0; | 38 virtual base::SingleThreadTaskRunner* GetIPCTaskRunner() = 0; |
39 | 39 |
40 // Returns the event object that becomes signalled when the main thread's | 40 // Returns the event object that becomes signalled when the main thread's |
41 // message loop exits. | 41 // message loop exits. |
42 virtual base::WaitableEvent* GetShutdownEvent() = 0; | 42 virtual base::WaitableEvent* GetShutdownEvent() = 0; |
43 | 43 |
44 // Duplicates a handle to the provided object, returning one that is valid | 44 // Duplicates a handle to the provided object, returning one that is valid |
45 // on the other side of the channel. This is part of the delegate interface | 45 // on the other side of the channel. This is part of the delegate interface |
46 // because both sides of the channel may not have sufficient permission to | 46 // because both sides of the channel may not have sufficient permission to |
47 // duplicate handles directly. The implementation must provide the same | 47 // duplicate handles directly. The implementation must provide the same |
48 // guarantees as ProxyChannel::ShareHandleWithRemote below. | 48 // guarantees as ProxyChannel::ShareHandleWithRemote below. |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 // remote side has crashed. | 118 // remote side has crashed. |
119 scoped_ptr<IPC::SyncChannel> channel_; | 119 scoped_ptr<IPC::SyncChannel> channel_; |
120 | 120 |
121 DISALLOW_COPY_AND_ASSIGN(ProxyChannel); | 121 DISALLOW_COPY_AND_ASSIGN(ProxyChannel); |
122 }; | 122 }; |
123 | 123 |
124 } // namespace proxy | 124 } // namespace proxy |
125 } // namespace ppapi | 125 } // namespace ppapi |
126 | 126 |
127 #endif // PPAPI_PROXY_PROXY_CHANNEL_H_ | 127 #endif // PPAPI_PROXY_PROXY_CHANNEL_H_ |
OLD | NEW |