1 : //
2 : // Automatically generated by ipdlc.
3 : // Edit at your own risk
4 : //
5 :
6 : #ifndef PAudioParent_h
7 : #define PAudioParent_h
8 :
9 : #include "mozilla/dom/PAudio.h"
10 : namespace mozilla {
11 : namespace dom {
12 : class PContentParent;
13 : } // namespace dom
14 : } // namespace mozilla
15 :
16 : #ifdef DEBUG
17 : #include "prenv.h"
18 : #endif // DEBUG
19 : #include "base/id_map.h"
20 : #include "mozilla/ipc/RPCChannel.h"
21 :
22 :
23 : namespace mozilla {
24 : namespace dom {
25 : class PContentParent;
26 : } // namespace dom
27 : } // namespace mozilla
28 :
29 : namespace mozilla {
30 : namespace dom {
31 :
32 :
33 : class /*NS_ABSTRACT_CLASS*/ PAudioParent :
34 : protected mozilla::ipc::RPCChannel::RPCListener,
35 : protected mozilla::ipc::IProtocolManager<mozilla::ipc::RPCChannel::RPCListener>
36 : {
37 : friend class mozilla::dom::PContentParent;
38 :
39 : protected:
40 : typedef mozilla::ipc::ActorHandle ActorHandle;
41 : typedef mozilla::ipc::Shmem Shmem;
42 : typedef mozilla::dom::PContentParent PContentParent;
43 : typedef base::ProcessId ProcessId;
44 : typedef mozilla::ipc::ProtocolId ProtocolId;
45 : typedef mozilla::ipc::Transport Transport;
46 : typedef mozilla::ipc::TransportDescriptor TransportDescriptor;
47 :
48 : typedef PAudio::State State;
49 :
50 : virtual bool
51 : RecvWrite(
52 : const nsCString& data,
53 : const PRUint32& frames) = 0;
54 : virtual bool
55 : RecvSetVolume(const float& aVolume) = 0;
56 : virtual bool
57 : RecvMinWriteSize() = 0;
58 : virtual bool
59 : RecvDrain() = 0;
60 : virtual bool
61 : RecvPause() = 0;
62 : virtual bool
63 : RecvResume() = 0;
64 : virtual bool
65 : RecvShutdown() = 0;
66 :
67 : virtual void
68 : ActorDestroy(ActorDestroyReason why);
69 :
70 : public:
71 : typedef IPC::Message Message;
72 : typedef mozilla::ipc::RPCChannel Channel;
73 : typedef mozilla::ipc::RPCChannel::RPCListener ChannelListener;
74 : typedef base::ProcessHandle ProcessHandle;
75 : typedef mozilla::ipc::AsyncChannel AsyncChannel;
76 : typedef mozilla::ipc::SharedMemory SharedMemory;
77 : typedef mozilla::ipc::Trigger Trigger;
78 :
79 : public:
80 : PAudioParent();
81 :
82 : virtual ~PAudioParent();
83 :
84 : PContentParent*
85 : Manager();
86 :
87 : PAudio::State
88 : state();
89 :
90 : static bool
91 : Send__delete__(PAudioParent* actor) NS_WARN_UNUSED_RESULT;
92 :
93 : bool
94 : SendPositionInFramesUpdate(
95 : const PRInt64& position,
96 : const PRInt64& time) NS_WARN_UNUSED_RESULT;
97 :
98 : bool
99 : SendMinWriteSizeDone(const PRInt32& frameCount) NS_WARN_UNUSED_RESULT;
100 :
101 : bool
102 : SendDrainDone() NS_WARN_UNUSED_RESULT;
103 :
104 : virtual int32
105 : Register(ChannelListener* aRouted);
106 : virtual int32
107 : RegisterID(
108 : ChannelListener* aRouted,
109 : int32 aId);
110 : virtual ChannelListener*
111 : Lookup(int32 aId);
112 : virtual void
113 : Unregister(int32 aId);
114 : virtual void
115 : RemoveManagee(
116 : int32 aProtocolId,
117 : ChannelListener* aListener);
118 : virtual Shmem::SharedMemory*
119 : CreateSharedMemory(
120 : size_t aSize,
121 : Shmem::SharedMemory::SharedMemoryType type,
122 : bool unsafe,
123 : Shmem::id_t* aId);
124 : virtual bool
125 : AdoptSharedMemory(
126 : Shmem::SharedMemory* segment,
127 : Shmem::id_t* aId);
128 : virtual Shmem::SharedMemory*
129 : LookupSharedMemory(Shmem::id_t aId);
130 : virtual bool
131 : IsTrackingSharedMemory(Shmem::SharedMemory* segment);
132 : virtual bool
133 : DestroySharedMemory(Shmem& aShmem);
134 : virtual ProcessHandle
135 : OtherProcess() const;
136 : virtual AsyncChannel*
137 : GetIPCChannel();
138 :
139 : virtual Result
140 : OnMessageReceived(const Message& __msg);
141 :
142 : virtual Result
143 : OnMessageReceived(
144 : const Message& __msg,
145 : Message*& __reply);
146 :
147 : virtual Result
148 : OnCallReceived(
149 : const Message& __msg,
150 : Message*& __reply);
151 :
152 : void
153 : OnProcessingError(Result code);
154 :
155 : bool
156 : OnReplyTimeout();
157 :
158 : void
159 : OnChannelClose();
160 :
161 : void
162 : OnChannelError();
163 :
164 : void
165 : OnChannelConnected(int32 pid);
166 :
167 : // Methods for managing shmem
168 : bool
169 : AllocShmem(
170 : size_t aSize,
171 : Shmem::SharedMemory::SharedMemoryType aType,
172 : Shmem* aMem);
173 :
174 : bool
175 : AllocUnsafeShmem(
176 : size_t aSize,
177 : Shmem::SharedMemory::SharedMemoryType aType,
178 : Shmem* aMem);
179 :
180 : bool
181 : AdoptShmem(
182 : Shmem& aMem,
183 : Shmem* aOutMem);
184 :
185 : bool
186 : DeallocShmem(Shmem& aMem);
187 :
188 : private:
189 : virtual void
190 : FatalError(const char* const msg) const;
191 :
192 : void
193 : DestroySubtree(ActorDestroyReason why);
194 :
195 : void
196 : DeallocSubtree();
197 :
198 : template<typename T>
199 : void
200 0 : Write(
201 : const T& __v,
202 : Message* __msg)
203 : {
204 0 : IPC::WriteParam(__msg, __v);
205 0 : }
206 :
207 : template<typename T>
208 : bool
209 0 : Read(
210 : T* __v,
211 : const Message* __msg,
212 : void** __iter)
213 : {
214 0 : return IPC::ReadParam(__msg, __iter, __v);
215 : }
216 :
217 : void
218 : Write(
219 : PAudioParent* __v,
220 : Message* __msg,
221 : bool __nullable);
222 :
223 : bool
224 : Read(
225 : PAudioParent** __v,
226 : const Message* __msg,
227 : void** __iter,
228 : bool __nullable) NS_WARN_UNUSED_RESULT;
229 :
230 : Channel* mChannel;
231 : int32 mId;
232 : mozilla::ipc::IProtocolManager<mozilla::ipc::RPCChannel::RPCListener>* mManager;
233 : State mState;
234 : };
235 :
236 :
237 : } // namespace dom
238 : } // namespace mozilla
239 :
240 : #if 0
241 :
242 : //-----------------------------------------------------------------------------
243 : // Skeleton implementation of abstract actor class
244 :
245 : // Header file contents
246 : namespace mozilla {
247 : namespace dom {
248 : class AudioParent :
249 : public PAudioParent
250 : {
251 : virtual bool
252 : RecvWrite(
253 : const nsCString& data,
254 : const PRUint32& frames);
255 :
256 : virtual bool
257 : RecvSetVolume(const float& aVolume);
258 :
259 : virtual bool
260 : RecvMinWriteSize();
261 :
262 : virtual bool
263 : RecvDrain();
264 :
265 : virtual bool
266 : RecvPause();
267 :
268 : virtual bool
269 : RecvResume();
270 :
271 : virtual bool
272 : RecvShutdown();
273 :
274 : AudioParent();
275 : virtual ~AudioParent();
276 : };
277 : } // namespace dom
278 : } // namespace mozilla
279 :
280 :
281 : // C++ file contents
282 : namespace mozilla {
283 : namespace dom {
284 : bool
285 : AudioParent::RecvWrite(
286 : const nsCString& data,
287 : const PRUint32& frames)
288 : {
289 : return false;
290 : }
291 :
292 : bool
293 : AudioParent::RecvSetVolume(const float& aVolume)
294 : {
295 : return false;
296 : }
297 :
298 : bool
299 : AudioParent::RecvMinWriteSize()
300 : {
301 : return false;
302 : }
303 :
304 : bool
305 : AudioParent::RecvDrain()
306 : {
307 : return false;
308 : }
309 :
310 : bool
311 : AudioParent::RecvPause()
312 : {
313 : return false;
314 : }
315 :
316 : bool
317 : AudioParent::RecvResume()
318 : {
319 : return false;
320 : }
321 :
322 : bool
323 : AudioParent::RecvShutdown()
324 : {
325 : return false;
326 : }
327 :
328 : AudioParent::AudioParent()
329 : {
330 : MOZ_COUNT_CTOR(AudioParent);
331 : }
332 :
333 : AudioParent::~AudioParent()
334 : {
335 : MOZ_COUNT_DTOR(AudioParent);
336 : }
337 :
338 : } // namespace dom
339 : } // namespace mozilla
340 : #endif // if 0
341 :
342 : #endif // ifndef PAudioParent_h
|