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