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