1 : //
2 : // Automatically generated by ipdlc.
3 : // Edit at your own risk
4 : //
5 :
6 : #ifndef PPluginScriptableObjectChild_h
7 : #define PPluginScriptableObjectChild_h
8 :
9 : #include "mozilla/plugins/PPluginScriptableObject.h"
10 : namespace mozilla {
11 : namespace plugins {
12 : class PPluginInstanceChild;
13 : } // namespace plugins
14 : } // namespace mozilla
15 :
16 : namespace mozilla {
17 : namespace plugins {
18 : class PPluginIdentifierChild;
19 : } // namespace plugins
20 : } // namespace mozilla
21 :
22 : #ifdef DEBUG
23 : #include "prenv.h"
24 : #endif // DEBUG
25 : #include "base/id_map.h"
26 : #include "mozilla/ipc/RPCChannel.h"
27 :
28 :
29 : namespace mozilla {
30 : namespace plugins {
31 : class PPluginInstanceChild;
32 : } // namespace plugins
33 : } // namespace mozilla
34 :
35 :
36 : namespace mozilla {
37 : namespace plugins {
38 : class PPluginModuleChild;
39 : } // namespace plugins
40 : } // namespace mozilla
41 :
42 : namespace mozilla {
43 : namespace plugins {
44 :
45 :
46 : class /*NS_ABSTRACT_CLASS*/ PPluginScriptableObjectChild :
47 : protected mozilla::ipc::RPCChannel::RPCListener,
48 : protected mozilla::ipc::IProtocolManager<mozilla::ipc::RPCChannel::RPCListener>
49 : {
50 : friend class mozilla::plugins::PPluginInstanceChild;
51 :
52 : friend class mozilla::plugins::PPluginModuleChild;
53 :
54 : protected:
55 : typedef mozilla::ipc::ActorHandle ActorHandle;
56 : typedef mozilla::plugins::Variant Variant;
57 : typedef mozilla::ipc::Shmem Shmem;
58 : typedef mozilla::void_t void_t;
59 : typedef mozilla::null_t null_t;
60 : typedef mozilla::plugins::PPluginInstanceChild PPluginInstanceChild;
61 : typedef mozilla::plugins::PPluginIdentifierChild PPluginIdentifierChild;
62 : typedef base::ProcessId ProcessId;
63 : typedef mozilla::ipc::ProtocolId ProtocolId;
64 : typedef mozilla::ipc::Transport Transport;
65 : typedef mozilla::ipc::TransportDescriptor TransportDescriptor;
66 :
67 : typedef PPluginScriptableObject::State State;
68 :
69 : virtual bool
70 : Recv__delete__();
71 : virtual bool
72 : AnswerInvalidate() = 0;
73 : virtual bool
74 : AnswerHasMethod(
75 : PPluginIdentifierChild* aId,
76 : bool* aHasMethod) = 0;
77 : virtual bool
78 : AnswerInvoke(
79 : PPluginIdentifierChild* aId,
80 : const InfallibleTArray<Variant>& aArgs,
81 : Variant* aResult,
82 : bool* aSuccess) = 0;
83 : virtual bool
84 : AnswerInvokeDefault(
85 : const InfallibleTArray<Variant>& aArgs,
86 : Variant* aResult,
87 : bool* aSuccess) = 0;
88 : virtual bool
89 : AnswerHasProperty(
90 : PPluginIdentifierChild* aId,
91 : bool* aHasProperty) = 0;
92 : virtual bool
93 : AnswerSetProperty(
94 : PPluginIdentifierChild* aId,
95 : const Variant& aValue,
96 : bool* aSuccess) = 0;
97 : virtual bool
98 : AnswerRemoveProperty(
99 : PPluginIdentifierChild* aId,
100 : bool* aSuccess) = 0;
101 : virtual bool
102 : AnswerEnumerate(
103 : InfallibleTArray<PPluginIdentifierChild*>* aProperties,
104 : bool* aSuccess) = 0;
105 : virtual bool
106 : AnswerConstruct(
107 : const InfallibleTArray<Variant>& aArgs,
108 : Variant* aResult,
109 : bool* aSuccess) = 0;
110 : virtual bool
111 : RecvProtect() = 0;
112 : virtual bool
113 : RecvUnprotect() = 0;
114 : virtual bool
115 : AnswerGetChildProperty(
116 : PPluginIdentifierChild* aId,
117 : bool* aHasProperty,
118 : bool* aHasMethod,
119 : Variant* aResult,
120 : bool* aSuccess) = 0;
121 :
122 : virtual void
123 : ActorDestroy(ActorDestroyReason why);
124 :
125 : public:
126 : typedef IPC::Message Message;
127 : typedef mozilla::ipc::RPCChannel Channel;
128 : typedef mozilla::ipc::RPCChannel::RPCListener ChannelListener;
129 : typedef base::ProcessHandle ProcessHandle;
130 : typedef mozilla::ipc::AsyncChannel AsyncChannel;
131 : typedef mozilla::ipc::SharedMemory SharedMemory;
132 : typedef mozilla::ipc::Trigger Trigger;
133 :
134 : public:
135 : PPluginScriptableObjectChild();
136 :
137 : virtual ~PPluginScriptableObjectChild();
138 :
139 : PPluginInstanceChild*
140 : Manager();
141 :
142 : PPluginScriptableObject::State
143 : state();
144 :
145 : static bool
146 : Send__delete__(PPluginScriptableObjectChild* actor);
147 :
148 : bool
149 : CallNPN_Evaluate(
150 : const nsCString& aScript,
151 : Variant* aResult,
152 : bool* aSuccess);
153 :
154 : bool
155 : CallHasMethod(
156 : PPluginIdentifierChild* aId,
157 : bool* aHasMethod);
158 :
159 : bool
160 : CallInvoke(
161 : PPluginIdentifierChild* aId,
162 : const InfallibleTArray<Variant>& aArgs,
163 : Variant* aResult,
164 : bool* aSuccess);
165 :
166 : bool
167 : CallInvokeDefault(
168 : const InfallibleTArray<Variant>& aArgs,
169 : Variant* aResult,
170 : bool* aSuccess);
171 :
172 : bool
173 : CallHasProperty(
174 : PPluginIdentifierChild* aId,
175 : bool* aHasProperty);
176 :
177 : bool
178 : CallSetProperty(
179 : PPluginIdentifierChild* aId,
180 : const Variant& aValue,
181 : bool* aSuccess);
182 :
183 : bool
184 : CallRemoveProperty(
185 : PPluginIdentifierChild* aId,
186 : bool* aSuccess);
187 :
188 : bool
189 : CallEnumerate(
190 : InfallibleTArray<PPluginIdentifierChild*>* aProperties,
191 : bool* aSuccess);
192 :
193 : bool
194 : CallConstruct(
195 : const InfallibleTArray<Variant>& aArgs,
196 : Variant* aResult,
197 : bool* aSuccess);
198 :
199 : bool
200 : SendProtect();
201 :
202 : bool
203 : SendUnprotect();
204 :
205 : bool
206 : CallGetParentProperty(
207 : PPluginIdentifierChild* aId,
208 : Variant* aResult,
209 : bool* aSuccess);
210 :
211 : virtual int32
212 : Register(ChannelListener* aRouted);
213 : virtual int32
214 : RegisterID(
215 : ChannelListener* aRouted,
216 : int32 aId);
217 : virtual ChannelListener*
218 : Lookup(int32 aId);
219 : virtual void
220 : Unregister(int32 aId);
221 : virtual void
222 : RemoveManagee(
223 : int32 aProtocolId,
224 : ChannelListener* aListener);
225 : virtual Shmem::SharedMemory*
226 : CreateSharedMemory(
227 : size_t aSize,
228 : Shmem::SharedMemory::SharedMemoryType type,
229 : bool unsafe,
230 : Shmem::id_t* aId);
231 : virtual bool
232 : AdoptSharedMemory(
233 : Shmem::SharedMemory* segment,
234 : Shmem::id_t* aId);
235 : virtual Shmem::SharedMemory*
236 : LookupSharedMemory(Shmem::id_t aId);
237 : virtual bool
238 : IsTrackingSharedMemory(Shmem::SharedMemory* segment);
239 : virtual bool
240 : DestroySharedMemory(Shmem& aShmem);
241 : virtual ProcessHandle
242 : OtherProcess() const;
243 : virtual AsyncChannel*
244 : GetIPCChannel();
245 :
246 : virtual Result
247 : OnMessageReceived(const Message& __msg);
248 :
249 : virtual Result
250 : OnMessageReceived(
251 : const Message& __msg,
252 : Message*& __reply);
253 :
254 : virtual Result
255 : OnCallReceived(
256 : const Message& __msg,
257 : Message*& __reply);
258 :
259 : void
260 : OnProcessingError(Result code);
261 :
262 : bool
263 : OnReplyTimeout();
264 :
265 : void
266 : OnChannelClose();
267 :
268 : void
269 : OnChannelError();
270 :
271 : void
272 : OnChannelConnected(int32 pid);
273 :
274 : // Methods for managing shmem
275 : bool
276 : AllocShmem(
277 : size_t aSize,
278 : Shmem::SharedMemory::SharedMemoryType aType,
279 : Shmem* aMem);
280 :
281 : bool
282 : AllocUnsafeShmem(
283 : size_t aSize,
284 : Shmem::SharedMemory::SharedMemoryType aType,
285 : Shmem* aMem);
286 :
287 : bool
288 : AdoptShmem(
289 : Shmem& aMem,
290 : Shmem* aOutMem);
291 :
292 : bool
293 : DeallocShmem(Shmem& aMem);
294 :
295 : private:
296 : virtual void
297 : FatalError(const char* const msg) const;
298 :
299 : void
300 : DestroySubtree(ActorDestroyReason why);
301 :
302 : void
303 : DeallocSubtree();
304 :
305 : template<typename T>
306 : void
307 0 : Write(
308 : const T& __v,
309 : Message* __msg)
310 : {
311 0 : IPC::WriteParam(__msg, __v);
312 0 : }
313 :
314 : template<typename T>
315 : bool
316 0 : Read(
317 : T* __v,
318 : const Message* __msg,
319 : void** __iter)
320 : {
321 0 : return IPC::ReadParam(__msg, __iter, __v);
322 : }
323 :
324 : void
325 : Write(
326 : const InfallibleTArray<Variant>& __v,
327 : Message* __msg);
328 :
329 : bool
330 : Read(
331 : InfallibleTArray<Variant>* __v,
332 : const Message* __msg,
333 : void** __iter) NS_WARN_UNUSED_RESULT;
334 :
335 : void
336 : Write(
337 : PPluginScriptableObjectChild* __v,
338 : Message* __msg,
339 : bool __nullable);
340 :
341 : bool
342 : Read(
343 : PPluginScriptableObjectChild** __v,
344 : const Message* __msg,
345 : void** __iter,
346 : bool __nullable) NS_WARN_UNUSED_RESULT;
347 :
348 : void
349 : Write(
350 : const InfallibleTArray<PPluginIdentifierChild*>& __v,
351 : Message* __msg);
352 :
353 : bool
354 : Read(
355 : InfallibleTArray<PPluginIdentifierChild*>* __v,
356 : const Message* __msg,
357 : void** __iter) NS_WARN_UNUSED_RESULT;
358 :
359 : void
360 : Write(
361 : const Variant& __v,
362 : Message* __msg);
363 :
364 : bool
365 : Read(
366 : Variant* __v,
367 : const Message* __msg,
368 : void** __iter) NS_WARN_UNUSED_RESULT;
369 :
370 : void
371 : Write(
372 : PPluginIdentifierChild* __v,
373 : Message* __msg,
374 : bool __nullable);
375 :
376 : bool
377 : Read(
378 : PPluginIdentifierChild** __v,
379 : const Message* __msg,
380 : void** __iter,
381 : bool __nullable) NS_WARN_UNUSED_RESULT;
382 :
383 : Channel* mChannel;
384 : int32 mId;
385 : mozilla::ipc::IProtocolManager<mozilla::ipc::RPCChannel::RPCListener>* mManager;
386 : State mState;
387 : };
388 :
389 :
390 : } // namespace plugins
391 : } // namespace mozilla
392 :
393 : #if 0
394 :
395 : //-----------------------------------------------------------------------------
396 : // Skeleton implementation of abstract actor class
397 :
398 : // Header file contents
399 : namespace mozilla {
400 : namespace plugins {
401 : class PluginScriptableObjectChild :
402 : public PPluginScriptableObjectChild
403 : {
404 : virtual bool
405 : AnswerInvalidate();
406 :
407 : virtual bool
408 : AnswerHasMethod(
409 : PPluginIdentifierChild* aId,
410 : bool* aHasMethod);
411 :
412 : virtual bool
413 : AnswerInvoke(
414 : PPluginIdentifierChild* aId,
415 : const InfallibleTArray<Variant>& aArgs,
416 : Variant* aResult,
417 : bool* aSuccess);
418 :
419 : virtual bool
420 : AnswerInvokeDefault(
421 : const InfallibleTArray<Variant>& aArgs,
422 : Variant* aResult,
423 : bool* aSuccess);
424 :
425 : virtual bool
426 : AnswerHasProperty(
427 : PPluginIdentifierChild* aId,
428 : bool* aHasProperty);
429 :
430 : virtual bool
431 : AnswerSetProperty(
432 : PPluginIdentifierChild* aId,
433 : const Variant& aValue,
434 : bool* aSuccess);
435 :
436 : virtual bool
437 : AnswerRemoveProperty(
438 : PPluginIdentifierChild* aId,
439 : bool* aSuccess);
440 :
441 : virtual bool
442 : AnswerEnumerate(
443 : InfallibleTArray<PPluginIdentifierChild*>* aProperties,
444 : bool* aSuccess);
445 :
446 : virtual bool
447 : AnswerConstruct(
448 : const InfallibleTArray<Variant>& aArgs,
449 : Variant* aResult,
450 : bool* aSuccess);
451 :
452 : virtual bool
453 : RecvProtect();
454 :
455 : virtual bool
456 : RecvUnprotect();
457 :
458 : virtual bool
459 : AnswerGetChildProperty(
460 : PPluginIdentifierChild* aId,
461 : bool* aHasProperty,
462 : bool* aHasMethod,
463 : Variant* aResult,
464 : bool* aSuccess);
465 :
466 : PluginScriptableObjectChild();
467 : virtual ~PluginScriptableObjectChild();
468 : };
469 : } // namespace plugins
470 : } // namespace mozilla
471 :
472 :
473 : // C++ file contents
474 : namespace mozilla {
475 : namespace plugins {
476 : bool
477 : PluginScriptableObjectChild::AnswerInvalidate()
478 : {
479 : return false;
480 : }
481 :
482 : bool
483 : PluginScriptableObjectChild::AnswerHasMethod(
484 : PPluginIdentifierChild* aId,
485 : bool* aHasMethod)
486 : {
487 : return false;
488 : }
489 :
490 : bool
491 : PluginScriptableObjectChild::AnswerInvoke(
492 : PPluginIdentifierChild* aId,
493 : const InfallibleTArray<Variant>& aArgs,
494 : Variant* aResult,
495 : bool* aSuccess)
496 : {
497 : return false;
498 : }
499 :
500 : bool
501 : PluginScriptableObjectChild::AnswerInvokeDefault(
502 : const InfallibleTArray<Variant>& aArgs,
503 : Variant* aResult,
504 : bool* aSuccess)
505 : {
506 : return false;
507 : }
508 :
509 : bool
510 : PluginScriptableObjectChild::AnswerHasProperty(
511 : PPluginIdentifierChild* aId,
512 : bool* aHasProperty)
513 : {
514 : return false;
515 : }
516 :
517 : bool
518 : PluginScriptableObjectChild::AnswerSetProperty(
519 : PPluginIdentifierChild* aId,
520 : const Variant& aValue,
521 : bool* aSuccess)
522 : {
523 : return false;
524 : }
525 :
526 : bool
527 : PluginScriptableObjectChild::AnswerRemoveProperty(
528 : PPluginIdentifierChild* aId,
529 : bool* aSuccess)
530 : {
531 : return false;
532 : }
533 :
534 : bool
535 : PluginScriptableObjectChild::AnswerEnumerate(
536 : InfallibleTArray<PPluginIdentifierChild*>* aProperties,
537 : bool* aSuccess)
538 : {
539 : return false;
540 : }
541 :
542 : bool
543 : PluginScriptableObjectChild::AnswerConstruct(
544 : const InfallibleTArray<Variant>& aArgs,
545 : Variant* aResult,
546 : bool* aSuccess)
547 : {
548 : return false;
549 : }
550 :
551 : bool
552 : PluginScriptableObjectChild::RecvProtect()
553 : {
554 : return false;
555 : }
556 :
557 : bool
558 : PluginScriptableObjectChild::RecvUnprotect()
559 : {
560 : return false;
561 : }
562 :
563 : bool
564 : PluginScriptableObjectChild::AnswerGetChildProperty(
565 : PPluginIdentifierChild* aId,
566 : bool* aHasProperty,
567 : bool* aHasMethod,
568 : Variant* aResult,
569 : bool* aSuccess)
570 : {
571 : return false;
572 : }
573 :
574 : PluginScriptableObjectChild::PluginScriptableObjectChild()
575 : {
576 : MOZ_COUNT_CTOR(PluginScriptableObjectChild);
577 : }
578 :
579 : PluginScriptableObjectChild::~PluginScriptableObjectChild()
580 : {
581 : MOZ_COUNT_DTOR(PluginScriptableObjectChild);
582 : }
583 :
584 : } // namespace plugins
585 : } // namespace mozilla
586 : #endif // if 0
587 :
588 : #endif // ifndef PPluginScriptableObjectChild_h
|