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