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