Line data Source code
1 : //
2 : // Automatically generated by ipdlc.
3 : // Edit at your own risk
4 : //
5 :
6 :
7 : #include "mozilla/net/PDNSRequestParent.h"
8 :
9 : #include "mozilla/net/PNeckoParent.h"
10 :
11 : #include "nsIFile.h"
12 : #include "GeckoProfiler.h"
13 :
14 : namespace mozilla {
15 : namespace net {
16 :
17 :
18 0 : auto PDNSRequestParent::Recv__delete__() -> mozilla::ipc::IPCResult
19 : {
20 0 : return IPC_OK();
21 : }
22 :
23 :
24 0 : MOZ_IMPLICIT PDNSRequestParent::PDNSRequestParent() :
25 : mozilla::ipc::IProtocol(mozilla::ipc::ParentSide),
26 0 : mState(PDNSRequest::__Dead)
27 : {
28 0 : MOZ_COUNT_CTOR(PDNSRequestParent);
29 0 : }
30 :
31 0 : PDNSRequestParent::~PDNSRequestParent()
32 : {
33 0 : MOZ_COUNT_DTOR(PDNSRequestParent);
34 0 : }
35 :
36 0 : auto PDNSRequestParent::Manager() const -> PNeckoParent*
37 : {
38 0 : return static_cast<PNeckoParent*>(IProtocol::Manager());
39 : }
40 :
41 0 : auto PDNSRequestParent::SendLookupCompleted(const DNSRequestResponse& reply) -> bool
42 : {
43 0 : IPC::Message* msg__ = PDNSRequest::Msg_LookupCompleted(Id());
44 :
45 0 : Write(reply, msg__);
46 : // Sentinel = 'reply'
47 0 : (msg__)->WriteSentinel(3357927609);
48 :
49 :
50 :
51 :
52 0 : if (mozilla::ipc::LoggingEnabledFor("PDNSRequestParent")) {
53 0 : mozilla::ipc::LogMessageForProtocol("PDNSRequestParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
54 : }
55 0 : AUTO_PROFILER_LABEL("PDNSRequest::Msg_LookupCompleted", OTHER);
56 0 : PDNSRequest::Transition(PDNSRequest::Msg_LookupCompleted__ID, (&(mState)));
57 :
58 0 : bool sendok__ = (GetIPCChannel())->Send(msg__);
59 0 : return sendok__;
60 : }
61 :
62 0 : auto PDNSRequestParent::RemoveManagee(
63 : int32_t aProtocolId,
64 : ProtocolBase* aListener) -> void
65 : {
66 0 : FatalError("unreached");
67 0 : return;
68 : }
69 :
70 0 : auto PDNSRequestParent::OnMessageReceived(const Message& msg__) -> PDNSRequestParent::Result
71 : {
72 0 : switch ((msg__).type()) {
73 : case PDNSRequest::Msg_CancelDNSRequest__ID:
74 : {
75 0 : if (mozilla::ipc::LoggingEnabledFor("PDNSRequestParent")) {
76 0 : mozilla::ipc::LogMessageForProtocol("PDNSRequestParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
77 : }
78 0 : AUTO_PROFILER_LABEL("PDNSRequest::Msg_CancelDNSRequest", OTHER);
79 :
80 0 : PickleIterator iter__(msg__);
81 0 : nsCString hostName;
82 0 : OriginAttributes originAttributes;
83 : uint32_t flags;
84 0 : nsCString networkInterface;
85 : nsresult reason;
86 :
87 0 : if ((!(Read((&(hostName)), (&(msg__)), (&(iter__)))))) {
88 0 : FatalError("Error deserializing 'nsCString'");
89 0 : return MsgValueError;
90 : }
91 : // Sentinel = 'hostName'
92 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 1367899915)))) {
93 0 : mozilla::ipc::SentinelReadError("Error deserializing 'nsCString'");
94 0 : return MsgValueError;
95 : }
96 0 : if ((!(Read((&(originAttributes)), (&(msg__)), (&(iter__)))))) {
97 0 : FatalError("Error deserializing 'OriginAttributes'");
98 0 : return MsgValueError;
99 : }
100 : // Sentinel = 'originAttributes'
101 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2655275965)))) {
102 0 : mozilla::ipc::SentinelReadError("Error deserializing 'OriginAttributes'");
103 0 : return MsgValueError;
104 : }
105 0 : if ((!(Read((&(flags)), (&(msg__)), (&(iter__)))))) {
106 0 : FatalError("Error deserializing 'uint32_t'");
107 0 : return MsgValueError;
108 : }
109 : // Sentinel = 'flags'
110 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2550519284)))) {
111 0 : mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'");
112 0 : return MsgValueError;
113 : }
114 0 : if ((!(Read((&(networkInterface)), (&(msg__)), (&(iter__)))))) {
115 0 : FatalError("Error deserializing 'nsCString'");
116 0 : return MsgValueError;
117 : }
118 : // Sentinel = 'networkInterface'
119 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 1813484207)))) {
120 0 : mozilla::ipc::SentinelReadError("Error deserializing 'nsCString'");
121 0 : return MsgValueError;
122 : }
123 0 : if ((!(Read((&(reason)), (&(msg__)), (&(iter__)))))) {
124 0 : FatalError("Error deserializing 'nsresult'");
125 0 : return MsgValueError;
126 : }
127 : // Sentinel = 'reason'
128 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 4151390930)))) {
129 0 : mozilla::ipc::SentinelReadError("Error deserializing 'nsresult'");
130 0 : return MsgValueError;
131 : }
132 0 : (msg__).EndRead(iter__, (msg__).type());
133 0 : PDNSRequest::Transition(PDNSRequest::Msg_CancelDNSRequest__ID, (&(mState)));
134 0 : if ((!(RecvCancelDNSRequest(mozilla::Move(hostName), mozilla::Move(originAttributes), mozilla::Move(flags), mozilla::Move(networkInterface), mozilla::Move(reason))))) {
135 0 : mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
136 : // Error handled in mozilla::ipc::IPCResult
137 0 : return MsgProcessingError;
138 : }
139 :
140 0 : return MsgProcessed;
141 : }
142 : case PDNSRequest::Msg___delete____ID:
143 : {
144 0 : if (mozilla::ipc::LoggingEnabledFor("PDNSRequestParent")) {
145 0 : mozilla::ipc::LogMessageForProtocol("PDNSRequestParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
146 : }
147 0 : AUTO_PROFILER_LABEL("PDNSRequest::Msg___delete__", OTHER);
148 :
149 0 : PickleIterator iter__(msg__);
150 : PDNSRequestParent* actor;
151 :
152 0 : if ((!(Read((&(actor)), (&(msg__)), (&(iter__)), false)))) {
153 0 : FatalError("Error deserializing 'PDNSRequestParent'");
154 0 : return MsgValueError;
155 : }
156 : // Sentinel = 'actor'
157 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 875202478)))) {
158 0 : mozilla::ipc::SentinelReadError("Error deserializing 'PDNSRequestParent'");
159 0 : return MsgValueError;
160 : }
161 0 : (msg__).EndRead(iter__, (msg__).type());
162 0 : PDNSRequest::Transition(PDNSRequest::Msg___delete____ID, (&(mState)));
163 0 : if ((!(Recv__delete__()))) {
164 0 : mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
165 : // Error handled in mozilla::ipc::IPCResult
166 0 : return MsgProcessingError;
167 : }
168 :
169 :
170 0 : IProtocol* mgr = (actor)->Manager();
171 0 : (actor)->DestroySubtree(Deletion);
172 0 : (actor)->DeallocSubtree();
173 0 : (mgr)->RemoveManagee(PDNSRequestMsgStart, actor);
174 :
175 0 : return MsgProcessed;
176 : }
177 : default:
178 : {
179 0 : return MsgNotKnown;
180 : }
181 : }
182 : }
183 :
184 0 : auto PDNSRequestParent::OnMessageReceived(
185 : const Message& msg__,
186 : Message*& reply__) -> PDNSRequestParent::Result
187 : {
188 0 : return MsgNotKnown;
189 : }
190 :
191 0 : auto PDNSRequestParent::OnCallReceived(
192 : const Message& msg__,
193 : Message*& reply__) -> PDNSRequestParent::Result
194 : {
195 0 : MOZ_ASSERT_UNREACHABLE("message protocol not supported");
196 : return MsgNotKnown;
197 : }
198 :
199 0 : auto PDNSRequestParent::GetProtocolTypeId() -> int32_t
200 : {
201 0 : return PDNSRequestMsgStart;
202 : }
203 :
204 0 : auto PDNSRequestParent::ProtocolName() const -> const char*
205 : {
206 0 : return "PDNSRequestParent";
207 : }
208 :
209 0 : auto PDNSRequestParent::DestroySubtree(ActorDestroyReason why) -> void
210 : {
211 : // Unregister from our manager.
212 0 : Unregister(Id());
213 :
214 : // Reject owning pending promises.
215 0 : (GetIPCChannel())->RejectPendingPromisesForActor(this);
216 :
217 : // Finally, destroy "us".
218 0 : ActorDestroy(why);
219 0 : }
220 :
221 0 : auto PDNSRequestParent::DeallocSubtree() -> void
222 : {
223 0 : }
224 :
225 0 : auto PDNSRequestParent::Write(
226 : const DNSRequestResponse& v__,
227 : Message* msg__) -> void
228 : {
229 : typedef DNSRequestResponse type__;
230 0 : Write(int((v__).type()), msg__);
231 : // Sentinel = 'DNSRequestResponse'
232 0 : (msg__)->WriteSentinel(1300723575);
233 :
234 0 : switch ((v__).type()) {
235 : case type__::TDNSRecord:
236 : {
237 0 : Write((v__).get_DNSRecord(), msg__);
238 : // Sentinel = 'TDNSRecord'
239 0 : (msg__)->WriteSentinel(2640728140);
240 0 : return;
241 : }
242 : case type__::Tnsresult:
243 : {
244 0 : Write((v__).get_nsresult(), msg__);
245 : // Sentinel = 'Tnsresult'
246 0 : (msg__)->WriteSentinel(2293764539);
247 0 : return;
248 : }
249 : default:
250 : {
251 0 : FatalError("unknown union type");
252 0 : return;
253 : }
254 : }
255 : }
256 :
257 0 : auto PDNSRequestParent::Read(
258 : DNSRequestResponse* v__,
259 : const Message* msg__,
260 : PickleIterator* iter__) -> bool
261 : {
262 : typedef DNSRequestResponse type__;
263 : int type;
264 0 : if ((!(Read((&(type)), msg__, iter__)))) {
265 0 : mozilla::ipc::UnionTypeReadError("DNSRequestResponse");
266 0 : return false;
267 : }
268 : // Sentinel = 'DNSRequestResponse'
269 0 : if ((!((msg__)->ReadSentinel(iter__, 1300723575)))) {
270 0 : mozilla::ipc::SentinelReadError("DNSRequestResponse");
271 0 : return false;
272 : }
273 :
274 0 : switch (type) {
275 : case type__::TDNSRecord:
276 : {
277 0 : DNSRecord tmp = DNSRecord();
278 0 : (*(v__)) = tmp;
279 0 : if ((!(Read((&((v__)->get_DNSRecord())), msg__, iter__)))) {
280 0 : FatalError("Error deserializing Union type");
281 0 : return false;
282 : }
283 : // Sentinel = 'TDNSRecord'
284 0 : if ((!((msg__)->ReadSentinel(iter__, 2640728140)))) {
285 0 : mozilla::ipc::SentinelReadError("Error deserializing Union type");
286 0 : return false;
287 : }
288 0 : return true;
289 : }
290 : case type__::Tnsresult:
291 : {
292 0 : nsresult tmp = nsresult();
293 0 : (*(v__)) = tmp;
294 0 : if ((!(Read((&((v__)->get_nsresult())), msg__, iter__)))) {
295 0 : FatalError("Error deserializing Union type");
296 0 : return false;
297 : }
298 : // Sentinel = 'Tnsresult'
299 0 : if ((!((msg__)->ReadSentinel(iter__, 2293764539)))) {
300 0 : mozilla::ipc::SentinelReadError("Error deserializing Union type");
301 0 : return false;
302 : }
303 0 : return true;
304 : }
305 : default:
306 : {
307 0 : FatalError("unknown union type");
308 0 : return false;
309 : }
310 : }
311 : }
312 :
313 0 : auto PDNSRequestParent::Write(
314 : const PDNSRequestParent* v__,
315 : Message* msg__,
316 : bool nullable__) -> void
317 : {
318 : int32_t id;
319 0 : if ((!(v__))) {
320 0 : if ((!(nullable__))) {
321 0 : FatalError("NULL actor value passed to non-nullable param");
322 : }
323 0 : id = 0;
324 : }
325 : else {
326 0 : id = (v__)->Id();
327 0 : if ((1) == (id)) {
328 0 : FatalError("actor has been |delete|d");
329 : }
330 : }
331 :
332 0 : Write(id, msg__);
333 0 : }
334 :
335 0 : auto PDNSRequestParent::Read(
336 : PDNSRequestParent** v__,
337 : const Message* msg__,
338 : PickleIterator* iter__,
339 : bool nullable__) -> bool
340 : {
341 0 : Maybe<mozilla::ipc::IProtocol*> actor = ReadActor(msg__, iter__, nullable__, "PDNSRequest", PDNSRequestMsgStart);
342 0 : if ((actor).isNothing()) {
343 0 : return false;
344 : }
345 :
346 0 : (*(v__)) = static_cast<PDNSRequestParent*>((actor).value());
347 0 : return true;
348 : }
349 :
350 0 : auto PDNSRequestParent::Write(
351 : const DNSRecord& v__,
352 : Message* msg__) -> void
353 : {
354 0 : Write((v__).canonicalName(), msg__);
355 : // Sentinel = 'canonicalName'
356 0 : (msg__)->WriteSentinel(2117440974);
357 0 : Write((v__).addrs(), msg__);
358 : // Sentinel = 'addrs'
359 0 : (msg__)->WriteSentinel(2934080597);
360 0 : }
361 :
362 0 : auto PDNSRequestParent::Read(
363 : DNSRecord* v__,
364 : const Message* msg__,
365 : PickleIterator* iter__) -> bool
366 : {
367 0 : if ((!(Read((&((v__)->canonicalName())), msg__, iter__)))) {
368 0 : FatalError("Error deserializing 'canonicalName' (nsCString) member of 'DNSRecord'");
369 0 : return false;
370 : }
371 : // Sentinel = 'canonicalName'
372 0 : if ((!((msg__)->ReadSentinel(iter__, 2117440974)))) {
373 0 : mozilla::ipc::SentinelReadError("Error deserializing 'canonicalName' (nsCString) member of 'DNSRecord'");
374 0 : return false;
375 : }
376 0 : if ((!(Read((&((v__)->addrs())), msg__, iter__)))) {
377 0 : FatalError("Error deserializing 'addrs' (NetAddrArray) member of 'DNSRecord'");
378 0 : return false;
379 : }
380 : // Sentinel = 'addrs'
381 0 : if ((!((msg__)->ReadSentinel(iter__, 2934080597)))) {
382 0 : mozilla::ipc::SentinelReadError("Error deserializing 'addrs' (NetAddrArray) member of 'DNSRecord'");
383 0 : return false;
384 : }
385 0 : return true;
386 : }
387 :
388 :
389 :
390 : } // namespace net
391 : } // namespace mozilla
|