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