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