OLD | NEW |
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 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/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/process.h" | 9 #include "base/process.h" |
10 #include "ipc/ipc_message.h" | 10 #include "ipc/ipc_message.h" |
11 #include "ipc/ipc_platform_file.h" | 11 #include "ipc/ipc_platform_file.h" |
12 #include "ipc/ipc_sync_channel.h" | 12 #include "ipc/ipc_sync_channel.h" |
13 #include "ppapi/proxy/ppapi_proxy_export.h" | 13 #include "ppapi/proxy/ppapi_proxy_export.h" |
14 | 14 |
15 namespace base { | 15 namespace base { |
16 class MessageLoopProxy; | 16 class MessageLoopProxy; |
17 class WaitableEvent; | 17 class WaitableEvent; |
18 } | 18 } |
19 | 19 |
20 namespace IPC { | 20 namespace IPC { |
21 class TestSink; | 21 class TestSink; |
22 } | 22 } |
23 | 23 |
24 namespace ppapi { | 24 namespace ppapi { |
25 namespace proxy { | 25 namespace proxy { |
26 | 26 |
27 class VarSerializationRules; | |
28 | |
29 class PPAPI_PROXY_EXPORT ProxyChannel | 27 class PPAPI_PROXY_EXPORT ProxyChannel |
30 : public IPC::Channel::Listener, | 28 : public IPC::Channel::Listener, |
31 public IPC::Message::Sender { | 29 public IPC::Message::Sender { |
32 public: | 30 public: |
33 typedef void (*ShutdownModuleFunc)(); | 31 typedef void (*ShutdownModuleFunc)(); |
34 | 32 |
35 class PPAPI_PROXY_EXPORT Delegate { | 33 class PPAPI_PROXY_EXPORT Delegate { |
36 public: | 34 public: |
37 virtual ~Delegate() {} | 35 virtual ~Delegate() {} |
38 | 36 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 // Will be NULL in some unit tests and if the remote side has crashed. | 68 // Will be NULL in some unit tests and if the remote side has crashed. |
71 IPC::SyncChannel* channel() const { | 69 IPC::SyncChannel* channel() const { |
72 return channel_.get(); | 70 return channel_.get(); |
73 } | 71 } |
74 | 72 |
75 #if defined(OS_POSIX) | 73 #if defined(OS_POSIX) |
76 int TakeRendererFD(); | 74 int TakeRendererFD(); |
77 #endif | 75 #endif |
78 | 76 |
79 protected: | 77 protected: |
80 ProxyChannel(base::ProcessHandle remote_process_handle); | 78 explicit ProxyChannel(base::ProcessHandle remote_process_handle); |
81 | 79 |
82 // You must call this function before anything else. Returns true on success. | 80 // You must call this function before anything else. Returns true on success. |
83 // The delegate pointer must outlive this class, ownership is not | 81 // The delegate pointer must outlive this class, ownership is not |
84 // transferred. | 82 // transferred. |
85 virtual bool InitWithChannel(Delegate* delegate, | 83 virtual bool InitWithChannel(Delegate* delegate, |
86 const IPC::ChannelHandle& channel_handle, | 84 const IPC::ChannelHandle& channel_handle, |
87 bool is_client); | 85 bool is_client); |
88 | 86 |
89 ProxyChannel::Delegate* delegate() const { | 87 ProxyChannel::Delegate* delegate() const { |
90 return delegate_; | 88 return delegate_; |
(...skipping 14 matching lines...) Expand all Loading... |
105 // remote side has crashed. | 103 // remote side has crashed. |
106 scoped_ptr<IPC::SyncChannel> channel_; | 104 scoped_ptr<IPC::SyncChannel> channel_; |
107 | 105 |
108 DISALLOW_COPY_AND_ASSIGN(ProxyChannel); | 106 DISALLOW_COPY_AND_ASSIGN(ProxyChannel); |
109 }; | 107 }; |
110 | 108 |
111 } // namespace proxy | 109 } // namespace proxy |
112 } // namespace ppapi | 110 } // namespace ppapi |
113 | 111 |
114 #endif // PPAPI_PROXY_PROXY_CHANNEL_H_ | 112 #endif // PPAPI_PROXY_PROXY_CHANNEL_H_ |
OLD | NEW |