1 : //
2 : // Automatically generated by ipdlc.
3 : // Edit at your own risk
4 : //
5 :
6 :
7 : #include "mozilla/net/PHttpChannelParent.h"
8 :
9 : #include "mozilla/net/PNeckoParent.h"
10 :
11 : typedef IPC::Message Message;
12 : typedef mozilla::ipc::RPCChannel Channel;
13 : typedef mozilla::ipc::RPCChannel::RPCListener ChannelListener;
14 : typedef base::ProcessHandle ProcessHandle;
15 : typedef mozilla::ipc::AsyncChannel AsyncChannel;
16 : typedef mozilla::ipc::SharedMemory SharedMemory;
17 : typedef mozilla::ipc::Trigger Trigger;
18 : typedef mozilla::ipc::ActorHandle ActorHandle;
19 : typedef mozilla::ipc::Shmem Shmem;
20 : typedef IPC::URI URI;
21 : typedef IPC::InputStream InputStream;
22 : using mozilla::net::PNeckoParent;
23 :
24 : namespace mozilla {
25 : namespace net {
26 :
27 :
28 : bool
29 0 : PHttpChannelParent::Recv__delete__()
30 : {
31 0 : return true;
32 : }
33 :
34 : void
35 0 : PHttpChannelParent::ActorDestroy(ActorDestroyReason why)
36 : {
37 0 : }
38 :
39 0 : PHttpChannelParent::PHttpChannelParent() :
40 : mId(0),
41 0 : mState(PHttpChannel::__Dead)
42 : {
43 0 : MOZ_COUNT_CTOR(PHttpChannelParent);
44 0 : }
45 :
46 0 : PHttpChannelParent::~PHttpChannelParent()
47 : {
48 0 : MOZ_COUNT_DTOR(PHttpChannelParent);
49 0 : }
50 :
51 : PNeckoParent*
52 0 : PHttpChannelParent::Manager()
53 : {
54 0 : return static_cast<PNeckoParent*>(mManager);
55 : }
56 :
57 : PHttpChannel::State
58 0 : PHttpChannelParent::state()
59 : {
60 0 : return mState;
61 : }
62 :
63 : bool
64 0 : PHttpChannelParent::SendOnStartRequest(
65 : const nsHttpResponseHead& responseHead,
66 : const bool& useResponseHead,
67 : const nsHttpHeaderArray& requestHeaders,
68 : const bool& isFromCache,
69 : const bool& cacheEntryAvailable,
70 : const PRUint32& cacheExpirationTime,
71 : const nsCString& cachedCharset,
72 : const nsCString& securityInfoSerialization,
73 : const PRNetAddr& selfAddr,
74 : const PRNetAddr& peerAddr)
75 : {
76 0 : PHttpChannel::Msg_OnStartRequest* __msg = new PHttpChannel::Msg_OnStartRequest();
77 :
78 0 : Write(responseHead, __msg);
79 0 : Write(useResponseHead, __msg);
80 0 : Write(requestHeaders, __msg);
81 0 : Write(isFromCache, __msg);
82 0 : Write(cacheEntryAvailable, __msg);
83 0 : Write(cacheExpirationTime, __msg);
84 0 : Write(cachedCharset, __msg);
85 0 : Write(securityInfoSerialization, __msg);
86 0 : Write(selfAddr, __msg);
87 0 : Write(peerAddr, __msg);
88 :
89 0 : (__msg)->set_routing_id(mId);
90 :
91 :
92 :
93 0 : if (mozilla::ipc::LoggingEnabled()) {
94 0 : (__msg)->Log("[PHttpChannelParent] Sending ", stderr);
95 : }
96 0 : if ((!(PHttpChannel::Transition(mState, Trigger(Trigger::Send, PHttpChannel::Msg_OnStartRequest__ID), (&(mState)))))) {
97 0 : NS_WARNING("bad state transition!");
98 : }
99 :
100 0 : bool __sendok = (mChannel)->Send(__msg);
101 0 : return __sendok;
102 : }
103 :
104 : bool
105 0 : PHttpChannelParent::SendOnTransportAndData(
106 : const nsresult& status,
107 : const PRUint64& progress,
108 : const PRUint64& progressMax,
109 : const nsCString& data,
110 : const PRUint32& offset,
111 : const PRUint32& count)
112 : {
113 0 : PHttpChannel::Msg_OnTransportAndData* __msg = new PHttpChannel::Msg_OnTransportAndData();
114 :
115 0 : Write(status, __msg);
116 0 : Write(progress, __msg);
117 0 : Write(progressMax, __msg);
118 0 : Write(data, __msg);
119 0 : Write(offset, __msg);
120 0 : Write(count, __msg);
121 :
122 0 : (__msg)->set_routing_id(mId);
123 :
124 :
125 :
126 0 : if (mozilla::ipc::LoggingEnabled()) {
127 0 : (__msg)->Log("[PHttpChannelParent] Sending ", stderr);
128 : }
129 0 : if ((!(PHttpChannel::Transition(mState, Trigger(Trigger::Send, PHttpChannel::Msg_OnTransportAndData__ID), (&(mState)))))) {
130 0 : NS_WARNING("bad state transition!");
131 : }
132 :
133 0 : bool __sendok = (mChannel)->Send(__msg);
134 0 : return __sendok;
135 : }
136 :
137 : bool
138 0 : PHttpChannelParent::SendOnStopRequest(const nsresult& statusCode)
139 : {
140 0 : PHttpChannel::Msg_OnStopRequest* __msg = new PHttpChannel::Msg_OnStopRequest();
141 :
142 0 : Write(statusCode, __msg);
143 :
144 0 : (__msg)->set_routing_id(mId);
145 :
146 :
147 :
148 0 : if (mozilla::ipc::LoggingEnabled()) {
149 0 : (__msg)->Log("[PHttpChannelParent] Sending ", stderr);
150 : }
151 0 : if ((!(PHttpChannel::Transition(mState, Trigger(Trigger::Send, PHttpChannel::Msg_OnStopRequest__ID), (&(mState)))))) {
152 0 : NS_WARNING("bad state transition!");
153 : }
154 :
155 0 : bool __sendok = (mChannel)->Send(__msg);
156 0 : return __sendok;
157 : }
158 :
159 : bool
160 0 : PHttpChannelParent::SendOnProgress(
161 : const PRUint64& progress,
162 : const PRUint64& progressMax)
163 : {
164 0 : PHttpChannel::Msg_OnProgress* __msg = new PHttpChannel::Msg_OnProgress();
165 :
166 0 : Write(progress, __msg);
167 0 : Write(progressMax, __msg);
168 :
169 0 : (__msg)->set_routing_id(mId);
170 :
171 :
172 :
173 0 : if (mozilla::ipc::LoggingEnabled()) {
174 0 : (__msg)->Log("[PHttpChannelParent] Sending ", stderr);
175 : }
176 0 : if ((!(PHttpChannel::Transition(mState, Trigger(Trigger::Send, PHttpChannel::Msg_OnProgress__ID), (&(mState)))))) {
177 0 : NS_WARNING("bad state transition!");
178 : }
179 :
180 0 : bool __sendok = (mChannel)->Send(__msg);
181 0 : return __sendok;
182 : }
183 :
184 : bool
185 0 : PHttpChannelParent::SendOnStatus(const nsresult& status)
186 : {
187 0 : PHttpChannel::Msg_OnStatus* __msg = new PHttpChannel::Msg_OnStatus();
188 :
189 0 : Write(status, __msg);
190 :
191 0 : (__msg)->set_routing_id(mId);
192 :
193 :
194 :
195 0 : if (mozilla::ipc::LoggingEnabled()) {
196 0 : (__msg)->Log("[PHttpChannelParent] Sending ", stderr);
197 : }
198 0 : if ((!(PHttpChannel::Transition(mState, Trigger(Trigger::Send, PHttpChannel::Msg_OnStatus__ID), (&(mState)))))) {
199 0 : NS_WARNING("bad state transition!");
200 : }
201 :
202 0 : bool __sendok = (mChannel)->Send(__msg);
203 0 : return __sendok;
204 : }
205 :
206 : bool
207 0 : PHttpChannelParent::SendFailedAsyncOpen(const nsresult& status)
208 : {
209 0 : PHttpChannel::Msg_FailedAsyncOpen* __msg = new PHttpChannel::Msg_FailedAsyncOpen();
210 :
211 0 : Write(status, __msg);
212 :
213 0 : (__msg)->set_routing_id(mId);
214 :
215 :
216 :
217 0 : if (mozilla::ipc::LoggingEnabled()) {
218 0 : (__msg)->Log("[PHttpChannelParent] Sending ", stderr);
219 : }
220 0 : if ((!(PHttpChannel::Transition(mState, Trigger(Trigger::Send, PHttpChannel::Msg_FailedAsyncOpen__ID), (&(mState)))))) {
221 0 : NS_WARNING("bad state transition!");
222 : }
223 :
224 0 : bool __sendok = (mChannel)->Send(__msg);
225 0 : return __sendok;
226 : }
227 :
228 : bool
229 0 : PHttpChannelParent::SendRedirect1Begin(
230 : const PRUint32& newChannelId,
231 : const URI& newUri,
232 : const PRUint32& redirectFlags,
233 : const nsHttpResponseHead& responseHead)
234 : {
235 0 : PHttpChannel::Msg_Redirect1Begin* __msg = new PHttpChannel::Msg_Redirect1Begin();
236 :
237 0 : Write(newChannelId, __msg);
238 0 : Write(newUri, __msg);
239 0 : Write(redirectFlags, __msg);
240 0 : Write(responseHead, __msg);
241 :
242 0 : (__msg)->set_routing_id(mId);
243 :
244 :
245 :
246 0 : if (mozilla::ipc::LoggingEnabled()) {
247 0 : (__msg)->Log("[PHttpChannelParent] Sending ", stderr);
248 : }
249 0 : if ((!(PHttpChannel::Transition(mState, Trigger(Trigger::Send, PHttpChannel::Msg_Redirect1Begin__ID), (&(mState)))))) {
250 0 : NS_WARNING("bad state transition!");
251 : }
252 :
253 0 : bool __sendok = (mChannel)->Send(__msg);
254 0 : return __sendok;
255 : }
256 :
257 : bool
258 0 : PHttpChannelParent::SendRedirect3Complete()
259 : {
260 0 : PHttpChannel::Msg_Redirect3Complete* __msg = new PHttpChannel::Msg_Redirect3Complete();
261 :
262 :
263 0 : (__msg)->set_routing_id(mId);
264 :
265 :
266 :
267 0 : if (mozilla::ipc::LoggingEnabled()) {
268 0 : (__msg)->Log("[PHttpChannelParent] Sending ", stderr);
269 : }
270 0 : if ((!(PHttpChannel::Transition(mState, Trigger(Trigger::Send, PHttpChannel::Msg_Redirect3Complete__ID), (&(mState)))))) {
271 0 : NS_WARNING("bad state transition!");
272 : }
273 :
274 0 : bool __sendok = (mChannel)->Send(__msg);
275 0 : return __sendok;
276 : }
277 :
278 : bool
279 0 : PHttpChannelParent::SendAssociateApplicationCache(
280 : const nsCString& groupID,
281 : const nsCString& clientID)
282 : {
283 0 : PHttpChannel::Msg_AssociateApplicationCache* __msg = new PHttpChannel::Msg_AssociateApplicationCache();
284 :
285 0 : Write(groupID, __msg);
286 0 : Write(clientID, __msg);
287 :
288 0 : (__msg)->set_routing_id(mId);
289 :
290 :
291 :
292 0 : if (mozilla::ipc::LoggingEnabled()) {
293 0 : (__msg)->Log("[PHttpChannelParent] Sending ", stderr);
294 : }
295 0 : if ((!(PHttpChannel::Transition(mState, Trigger(Trigger::Send, PHttpChannel::Msg_AssociateApplicationCache__ID), (&(mState)))))) {
296 0 : NS_WARNING("bad state transition!");
297 : }
298 :
299 0 : bool __sendok = (mChannel)->Send(__msg);
300 0 : return __sendok;
301 : }
302 :
303 : bool
304 0 : PHttpChannelParent::SendDeleteSelf()
305 : {
306 0 : PHttpChannel::Msg_DeleteSelf* __msg = new PHttpChannel::Msg_DeleteSelf();
307 :
308 :
309 0 : (__msg)->set_routing_id(mId);
310 :
311 :
312 :
313 0 : if (mozilla::ipc::LoggingEnabled()) {
314 0 : (__msg)->Log("[PHttpChannelParent] Sending ", stderr);
315 : }
316 0 : if ((!(PHttpChannel::Transition(mState, Trigger(Trigger::Send, PHttpChannel::Msg_DeleteSelf__ID), (&(mState)))))) {
317 0 : NS_WARNING("bad state transition!");
318 : }
319 :
320 0 : bool __sendok = (mChannel)->Send(__msg);
321 0 : return __sendok;
322 : }
323 :
324 : int32
325 0 : PHttpChannelParent::Register(ChannelListener* aRouted)
326 : {
327 0 : return (mManager)->Register(aRouted);
328 : }
329 :
330 : int32
331 0 : PHttpChannelParent::RegisterID(
332 : ChannelListener* aRouted,
333 : int32 aId)
334 : {
335 0 : return (mManager)->RegisterID(aRouted, aId);
336 : }
337 :
338 : ChannelListener*
339 0 : PHttpChannelParent::Lookup(int32 aId)
340 : {
341 0 : return (mManager)->Lookup(aId);
342 : }
343 :
344 : void
345 0 : PHttpChannelParent::Unregister(int32 aId)
346 : {
347 0 : return (mManager)->Unregister(aId);
348 : }
349 :
350 : void
351 0 : PHttpChannelParent::RemoveManagee(
352 : int32 aProtocolId,
353 : ChannelListener* aListener)
354 : {
355 0 : NS_RUNTIMEABORT("unreached");
356 : return;
357 : }
358 :
359 : Shmem::SharedMemory*
360 0 : PHttpChannelParent::CreateSharedMemory(
361 : size_t aSize,
362 : Shmem::SharedMemory::SharedMemoryType type,
363 : bool unsafe,
364 : Shmem::id_t* aId)
365 : {
366 0 : return (mManager)->CreateSharedMemory(aSize, type, unsafe, aId);
367 : }
368 :
369 : bool
370 0 : PHttpChannelParent::AdoptSharedMemory(
371 : Shmem::SharedMemory* segment,
372 : Shmem::id_t* aId)
373 : {
374 0 : return (mManager)->AdoptSharedMemory(segment, aId);
375 : }
376 :
377 : Shmem::SharedMemory*
378 0 : PHttpChannelParent::LookupSharedMemory(Shmem::id_t aId)
379 : {
380 0 : return (mManager)->LookupSharedMemory(aId);
381 : }
382 :
383 : bool
384 0 : PHttpChannelParent::IsTrackingSharedMemory(Shmem::SharedMemory* segment)
385 : {
386 0 : return (mManager)->IsTrackingSharedMemory(segment);
387 : }
388 :
389 : bool
390 0 : PHttpChannelParent::DestroySharedMemory(Shmem& aShmem)
391 : {
392 0 : return (mManager)->DestroySharedMemory(aShmem);
393 : }
394 :
395 : ProcessHandle
396 0 : PHttpChannelParent::OtherProcess() const
397 : {
398 0 : return (mManager)->OtherProcess();
399 : }
400 :
401 : AsyncChannel*
402 0 : PHttpChannelParent::GetIPCChannel()
403 : {
404 0 : return mChannel;
405 : }
406 :
407 : PHttpChannelParent::Result
408 0 : PHttpChannelParent::OnMessageReceived(const Message& __msg)
409 : {
410 0 : switch ((__msg).type()) {
411 : case PHttpChannel::Msg_AsyncOpen__ID:
412 : {
413 0 : (const_cast<Message&>(__msg)).set_name("PHttpChannel::Msg_AsyncOpen");
414 0 : if (mozilla::ipc::LoggingEnabled()) {
415 0 : (static_cast<const PHttpChannel::Msg_AsyncOpen*>((&(__msg))))->Log("[PHttpChannelParent] Received ", stderr);
416 : }
417 :
418 0 : void* __iter = 0;
419 0 : URI uri;
420 0 : URI original;
421 0 : URI doc;
422 0 : URI referrer;
423 : PRUint32 loadFlags;
424 0 : RequestHeaderTuples requestHeaders;
425 : nsHttpAtom requestMethod;
426 0 : InputStream uploadStream;
427 : bool uploadStreamHasHeaders;
428 : PRUint16 priority;
429 : PRUint8 redirectionLimit;
430 : bool allowPipelining;
431 : bool forceAllowThirdPartyCookie;
432 : bool resumeAt;
433 : PRUint64 startPos;
434 0 : nsCString entityID;
435 : bool chooseApplicationCache;
436 0 : nsCString appCacheClientID;
437 : bool allowSpdy;
438 :
439 0 : if ((!(Read((&(uri)), (&(__msg)), (&(__iter)))))) {
440 0 : FatalError("error deserializing (better message TODO)");
441 0 : return MsgValueError;
442 : }
443 0 : if ((!(Read((&(original)), (&(__msg)), (&(__iter)))))) {
444 0 : FatalError("error deserializing (better message TODO)");
445 0 : return MsgValueError;
446 : }
447 0 : if ((!(Read((&(doc)), (&(__msg)), (&(__iter)))))) {
448 0 : FatalError("error deserializing (better message TODO)");
449 0 : return MsgValueError;
450 : }
451 0 : if ((!(Read((&(referrer)), (&(__msg)), (&(__iter)))))) {
452 0 : FatalError("error deserializing (better message TODO)");
453 0 : return MsgValueError;
454 : }
455 0 : if ((!(Read((&(loadFlags)), (&(__msg)), (&(__iter)))))) {
456 0 : FatalError("error deserializing (better message TODO)");
457 0 : return MsgValueError;
458 : }
459 0 : if ((!(Read((&(requestHeaders)), (&(__msg)), (&(__iter)))))) {
460 0 : FatalError("error deserializing (better message TODO)");
461 0 : return MsgValueError;
462 : }
463 0 : if ((!(Read((&(requestMethod)), (&(__msg)), (&(__iter)))))) {
464 0 : FatalError("error deserializing (better message TODO)");
465 0 : return MsgValueError;
466 : }
467 0 : if ((!(Read((&(uploadStream)), (&(__msg)), (&(__iter)))))) {
468 0 : FatalError("error deserializing (better message TODO)");
469 0 : return MsgValueError;
470 : }
471 0 : if ((!(Read((&(uploadStreamHasHeaders)), (&(__msg)), (&(__iter)))))) {
472 0 : FatalError("error deserializing (better message TODO)");
473 0 : return MsgValueError;
474 : }
475 0 : if ((!(Read((&(priority)), (&(__msg)), (&(__iter)))))) {
476 0 : FatalError("error deserializing (better message TODO)");
477 0 : return MsgValueError;
478 : }
479 0 : if ((!(Read((&(redirectionLimit)), (&(__msg)), (&(__iter)))))) {
480 0 : FatalError("error deserializing (better message TODO)");
481 0 : return MsgValueError;
482 : }
483 0 : if ((!(Read((&(allowPipelining)), (&(__msg)), (&(__iter)))))) {
484 0 : FatalError("error deserializing (better message TODO)");
485 0 : return MsgValueError;
486 : }
487 0 : if ((!(Read((&(forceAllowThirdPartyCookie)), (&(__msg)), (&(__iter)))))) {
488 0 : FatalError("error deserializing (better message TODO)");
489 0 : return MsgValueError;
490 : }
491 0 : if ((!(Read((&(resumeAt)), (&(__msg)), (&(__iter)))))) {
492 0 : FatalError("error deserializing (better message TODO)");
493 0 : return MsgValueError;
494 : }
495 0 : if ((!(Read((&(startPos)), (&(__msg)), (&(__iter)))))) {
496 0 : FatalError("error deserializing (better message TODO)");
497 0 : return MsgValueError;
498 : }
499 0 : if ((!(Read((&(entityID)), (&(__msg)), (&(__iter)))))) {
500 0 : FatalError("error deserializing (better message TODO)");
501 0 : return MsgValueError;
502 : }
503 0 : if ((!(Read((&(chooseApplicationCache)), (&(__msg)), (&(__iter)))))) {
504 0 : FatalError("error deserializing (better message TODO)");
505 0 : return MsgValueError;
506 : }
507 0 : if ((!(Read((&(appCacheClientID)), (&(__msg)), (&(__iter)))))) {
508 0 : FatalError("error deserializing (better message TODO)");
509 0 : return MsgValueError;
510 : }
511 0 : if ((!(Read((&(allowSpdy)), (&(__msg)), (&(__iter)))))) {
512 0 : FatalError("error deserializing (better message TODO)");
513 0 : return MsgValueError;
514 : }
515 0 : (__msg).EndRead(__iter);
516 0 : if ((!(PHttpChannel::Transition(mState, Trigger(Trigger::Recv, PHttpChannel::Msg_AsyncOpen__ID), (&(mState)))))) {
517 0 : NS_WARNING("bad state transition!");
518 : }
519 0 : if ((!(RecvAsyncOpen(uri, original, doc, referrer, loadFlags, requestHeaders, requestMethod, uploadStream, uploadStreamHasHeaders, priority, redirectionLimit, allowPipelining, forceAllowThirdPartyCookie, resumeAt, startPos, entityID, chooseApplicationCache, appCacheClientID, allowSpdy)))) {
520 0 : return MsgProcessingError;
521 : }
522 :
523 0 : return MsgProcessed;
524 : }
525 : case PHttpChannel::Msg_ConnectChannel__ID:
526 : {
527 0 : (const_cast<Message&>(__msg)).set_name("PHttpChannel::Msg_ConnectChannel");
528 0 : if (mozilla::ipc::LoggingEnabled()) {
529 0 : (static_cast<const PHttpChannel::Msg_ConnectChannel*>((&(__msg))))->Log("[PHttpChannelParent] Received ", stderr);
530 : }
531 :
532 0 : void* __iter = 0;
533 : PRUint32 channelId;
534 :
535 0 : if ((!(Read((&(channelId)), (&(__msg)), (&(__iter)))))) {
536 0 : FatalError("error deserializing (better message TODO)");
537 0 : return MsgValueError;
538 : }
539 0 : (__msg).EndRead(__iter);
540 0 : if ((!(PHttpChannel::Transition(mState, Trigger(Trigger::Recv, PHttpChannel::Msg_ConnectChannel__ID), (&(mState)))))) {
541 0 : NS_WARNING("bad state transition!");
542 : }
543 0 : if ((!(RecvConnectChannel(channelId)))) {
544 0 : return MsgProcessingError;
545 : }
546 :
547 0 : return MsgProcessed;
548 : }
549 : case PHttpChannel::Msg_SetPriority__ID:
550 : {
551 0 : (const_cast<Message&>(__msg)).set_name("PHttpChannel::Msg_SetPriority");
552 0 : if (mozilla::ipc::LoggingEnabled()) {
553 0 : (static_cast<const PHttpChannel::Msg_SetPriority*>((&(__msg))))->Log("[PHttpChannelParent] Received ", stderr);
554 : }
555 :
556 0 : void* __iter = 0;
557 : PRUint16 priority;
558 :
559 0 : if ((!(Read((&(priority)), (&(__msg)), (&(__iter)))))) {
560 0 : FatalError("error deserializing (better message TODO)");
561 0 : return MsgValueError;
562 : }
563 0 : (__msg).EndRead(__iter);
564 0 : if ((!(PHttpChannel::Transition(mState, Trigger(Trigger::Recv, PHttpChannel::Msg_SetPriority__ID), (&(mState)))))) {
565 0 : NS_WARNING("bad state transition!");
566 : }
567 0 : if ((!(RecvSetPriority(priority)))) {
568 0 : return MsgProcessingError;
569 : }
570 :
571 0 : return MsgProcessed;
572 : }
573 : case PHttpChannel::Msg_SetCacheTokenCachedCharset__ID:
574 : {
575 0 : (const_cast<Message&>(__msg)).set_name("PHttpChannel::Msg_SetCacheTokenCachedCharset");
576 0 : if (mozilla::ipc::LoggingEnabled()) {
577 0 : (static_cast<const PHttpChannel::Msg_SetCacheTokenCachedCharset*>((&(__msg))))->Log("[PHttpChannelParent] Received ", stderr);
578 : }
579 :
580 0 : void* __iter = 0;
581 0 : nsCString charset;
582 :
583 0 : if ((!(Read((&(charset)), (&(__msg)), (&(__iter)))))) {
584 0 : FatalError("error deserializing (better message TODO)");
585 0 : return MsgValueError;
586 : }
587 0 : (__msg).EndRead(__iter);
588 0 : if ((!(PHttpChannel::Transition(mState, Trigger(Trigger::Recv, PHttpChannel::Msg_SetCacheTokenCachedCharset__ID), (&(mState)))))) {
589 0 : NS_WARNING("bad state transition!");
590 : }
591 0 : if ((!(RecvSetCacheTokenCachedCharset(charset)))) {
592 0 : return MsgProcessingError;
593 : }
594 :
595 0 : return MsgProcessed;
596 : }
597 : case PHttpChannel::Msg_UpdateAssociatedContentSecurity__ID:
598 : {
599 0 : (const_cast<Message&>(__msg)).set_name("PHttpChannel::Msg_UpdateAssociatedContentSecurity");
600 0 : if (mozilla::ipc::LoggingEnabled()) {
601 0 : (static_cast<const PHttpChannel::Msg_UpdateAssociatedContentSecurity*>((&(__msg))))->Log("[PHttpChannelParent] Received ", stderr);
602 : }
603 :
604 0 : void* __iter = 0;
605 : PRInt32 high;
606 : PRInt32 low;
607 : PRInt32 broken;
608 : PRInt32 no;
609 :
610 0 : if ((!(Read((&(high)), (&(__msg)), (&(__iter)))))) {
611 0 : FatalError("error deserializing (better message TODO)");
612 0 : return MsgValueError;
613 : }
614 0 : if ((!(Read((&(low)), (&(__msg)), (&(__iter)))))) {
615 0 : FatalError("error deserializing (better message TODO)");
616 0 : return MsgValueError;
617 : }
618 0 : if ((!(Read((&(broken)), (&(__msg)), (&(__iter)))))) {
619 0 : FatalError("error deserializing (better message TODO)");
620 0 : return MsgValueError;
621 : }
622 0 : if ((!(Read((&(no)), (&(__msg)), (&(__iter)))))) {
623 0 : FatalError("error deserializing (better message TODO)");
624 0 : return MsgValueError;
625 : }
626 0 : (__msg).EndRead(__iter);
627 0 : if ((!(PHttpChannel::Transition(mState, Trigger(Trigger::Recv, PHttpChannel::Msg_UpdateAssociatedContentSecurity__ID), (&(mState)))))) {
628 0 : NS_WARNING("bad state transition!");
629 : }
630 0 : if ((!(RecvUpdateAssociatedContentSecurity(high, low, broken, no)))) {
631 0 : return MsgProcessingError;
632 : }
633 :
634 0 : return MsgProcessed;
635 : }
636 : case PHttpChannel::Msg_Suspend__ID:
637 : {
638 0 : (const_cast<Message&>(__msg)).set_name("PHttpChannel::Msg_Suspend");
639 0 : if (mozilla::ipc::LoggingEnabled()) {
640 0 : (static_cast<const PHttpChannel::Msg_Suspend*>((&(__msg))))->Log("[PHttpChannelParent] Received ", stderr);
641 : }
642 :
643 0 : if ((!(PHttpChannel::Transition(mState, Trigger(Trigger::Recv, PHttpChannel::Msg_Suspend__ID), (&(mState)))))) {
644 0 : NS_WARNING("bad state transition!");
645 : }
646 0 : if ((!(RecvSuspend()))) {
647 0 : return MsgProcessingError;
648 : }
649 :
650 0 : return MsgProcessed;
651 : }
652 : case PHttpChannel::Msg_Resume__ID:
653 : {
654 0 : (const_cast<Message&>(__msg)).set_name("PHttpChannel::Msg_Resume");
655 0 : if (mozilla::ipc::LoggingEnabled()) {
656 0 : (static_cast<const PHttpChannel::Msg_Resume*>((&(__msg))))->Log("[PHttpChannelParent] Received ", stderr);
657 : }
658 :
659 0 : if ((!(PHttpChannel::Transition(mState, Trigger(Trigger::Recv, PHttpChannel::Msg_Resume__ID), (&(mState)))))) {
660 0 : NS_WARNING("bad state transition!");
661 : }
662 0 : if ((!(RecvResume()))) {
663 0 : return MsgProcessingError;
664 : }
665 :
666 0 : return MsgProcessed;
667 : }
668 : case PHttpChannel::Msg_Cancel__ID:
669 : {
670 0 : (const_cast<Message&>(__msg)).set_name("PHttpChannel::Msg_Cancel");
671 0 : if (mozilla::ipc::LoggingEnabled()) {
672 0 : (static_cast<const PHttpChannel::Msg_Cancel*>((&(__msg))))->Log("[PHttpChannelParent] Received ", stderr);
673 : }
674 :
675 0 : void* __iter = 0;
676 : nsresult status;
677 :
678 0 : if ((!(Read((&(status)), (&(__msg)), (&(__iter)))))) {
679 0 : FatalError("error deserializing (better message TODO)");
680 0 : return MsgValueError;
681 : }
682 0 : (__msg).EndRead(__iter);
683 0 : if ((!(PHttpChannel::Transition(mState, Trigger(Trigger::Recv, PHttpChannel::Msg_Cancel__ID), (&(mState)))))) {
684 0 : NS_WARNING("bad state transition!");
685 : }
686 0 : if ((!(RecvCancel(status)))) {
687 0 : return MsgProcessingError;
688 : }
689 :
690 0 : return MsgProcessed;
691 : }
692 : case PHttpChannel::Msg_Redirect2Verify__ID:
693 : {
694 0 : (const_cast<Message&>(__msg)).set_name("PHttpChannel::Msg_Redirect2Verify");
695 0 : if (mozilla::ipc::LoggingEnabled()) {
696 0 : (static_cast<const PHttpChannel::Msg_Redirect2Verify*>((&(__msg))))->Log("[PHttpChannelParent] Received ", stderr);
697 : }
698 :
699 0 : void* __iter = 0;
700 : nsresult result;
701 0 : RequestHeaderTuples changedHeaders;
702 :
703 0 : if ((!(Read((&(result)), (&(__msg)), (&(__iter)))))) {
704 0 : FatalError("error deserializing (better message TODO)");
705 0 : return MsgValueError;
706 : }
707 0 : if ((!(Read((&(changedHeaders)), (&(__msg)), (&(__iter)))))) {
708 0 : FatalError("error deserializing (better message TODO)");
709 0 : return MsgValueError;
710 : }
711 0 : (__msg).EndRead(__iter);
712 0 : if ((!(PHttpChannel::Transition(mState, Trigger(Trigger::Recv, PHttpChannel::Msg_Redirect2Verify__ID), (&(mState)))))) {
713 0 : NS_WARNING("bad state transition!");
714 : }
715 0 : if ((!(RecvRedirect2Verify(result, changedHeaders)))) {
716 0 : return MsgProcessingError;
717 : }
718 :
719 0 : return MsgProcessed;
720 : }
721 : case PHttpChannel::Msg_DocumentChannelCleanup__ID:
722 : {
723 0 : (const_cast<Message&>(__msg)).set_name("PHttpChannel::Msg_DocumentChannelCleanup");
724 0 : if (mozilla::ipc::LoggingEnabled()) {
725 0 : (static_cast<const PHttpChannel::Msg_DocumentChannelCleanup*>((&(__msg))))->Log("[PHttpChannelParent] Received ", stderr);
726 : }
727 :
728 0 : if ((!(PHttpChannel::Transition(mState, Trigger(Trigger::Recv, PHttpChannel::Msg_DocumentChannelCleanup__ID), (&(mState)))))) {
729 0 : NS_WARNING("bad state transition!");
730 : }
731 0 : if ((!(RecvDocumentChannelCleanup()))) {
732 0 : return MsgProcessingError;
733 : }
734 :
735 0 : return MsgProcessed;
736 : }
737 : case PHttpChannel::Msg_MarkOfflineCacheEntryAsForeign__ID:
738 : {
739 0 : (const_cast<Message&>(__msg)).set_name("PHttpChannel::Msg_MarkOfflineCacheEntryAsForeign");
740 0 : if (mozilla::ipc::LoggingEnabled()) {
741 0 : (static_cast<const PHttpChannel::Msg_MarkOfflineCacheEntryAsForeign*>((&(__msg))))->Log("[PHttpChannelParent] Received ", stderr);
742 : }
743 :
744 0 : if ((!(PHttpChannel::Transition(mState, Trigger(Trigger::Recv, PHttpChannel::Msg_MarkOfflineCacheEntryAsForeign__ID), (&(mState)))))) {
745 0 : NS_WARNING("bad state transition!");
746 : }
747 0 : if ((!(RecvMarkOfflineCacheEntryAsForeign()))) {
748 0 : return MsgProcessingError;
749 : }
750 :
751 0 : return MsgProcessed;
752 : }
753 : case PHttpChannel::Msg___delete____ID:
754 : {
755 0 : (const_cast<Message&>(__msg)).set_name("PHttpChannel::Msg___delete__");
756 0 : if (mozilla::ipc::LoggingEnabled()) {
757 0 : (static_cast<const PHttpChannel::Msg___delete__*>((&(__msg))))->Log("[PHttpChannelParent] Received ", stderr);
758 : }
759 :
760 0 : void* __iter = 0;
761 : PHttpChannelParent* actor;
762 :
763 0 : if ((!(Read((&(actor)), (&(__msg)), (&(__iter)), false)))) {
764 0 : FatalError("error deserializing (better message TODO)");
765 0 : return MsgValueError;
766 : }
767 0 : (__msg).EndRead(__iter);
768 0 : if ((!(PHttpChannel::Transition(mState, Trigger(Trigger::Recv, PHttpChannel::Msg___delete____ID), (&(mState)))))) {
769 0 : NS_WARNING("bad state transition!");
770 : }
771 0 : if ((!(Recv__delete__()))) {
772 0 : return MsgProcessingError;
773 : }
774 :
775 0 : (actor)->DestroySubtree(Deletion);
776 0 : (actor)->DeallocSubtree();
777 0 : ((actor)->mManager)->RemoveManagee(PHttpChannelMsgStart, actor);
778 :
779 :
780 0 : return MsgProcessed;
781 : }
782 : default:
783 : {
784 0 : return MsgNotKnown;
785 : }
786 : }
787 : }
788 :
789 : PHttpChannelParent::Result
790 0 : PHttpChannelParent::OnMessageReceived(
791 : const Message& __msg,
792 : Message*& __reply)
793 : {
794 0 : return MsgNotKnown;
795 : }
796 :
797 : PHttpChannelParent::Result
798 0 : PHttpChannelParent::OnCallReceived(
799 : const Message& __msg,
800 : Message*& __reply)
801 : {
802 0 : return MsgNotKnown;
803 : }
804 :
805 : void
806 0 : PHttpChannelParent::OnProcessingError(Result code)
807 : {
808 0 : NS_RUNTIMEABORT("`OnProcessingError' called on non-toplevel actor");
809 0 : }
810 :
811 : bool
812 0 : PHttpChannelParent::OnReplyTimeout()
813 : {
814 0 : NS_RUNTIMEABORT("`OnReplyTimeout' called on non-toplevel actor");
815 0 : return false;
816 : }
817 :
818 : void
819 0 : PHttpChannelParent::OnChannelClose()
820 : {
821 0 : NS_RUNTIMEABORT("`OnClose' called on non-toplevel actor");
822 0 : }
823 :
824 : void
825 0 : PHttpChannelParent::OnChannelError()
826 : {
827 0 : NS_RUNTIMEABORT("`OnError' called on non-toplevel actor");
828 0 : }
829 :
830 : void
831 0 : PHttpChannelParent::OnChannelConnected(int32 pid)
832 : {
833 0 : NS_RUNTIMEABORT("'OnConnected' called on non-toplevel actor");
834 0 : }
835 :
836 : bool
837 0 : PHttpChannelParent::AllocShmem(
838 : size_t aSize,
839 : Shmem::SharedMemory::SharedMemoryType aType,
840 : Shmem* aMem)
841 : {
842 : Shmem::id_t aId;
843 0 : nsAutoPtr<Shmem::SharedMemory> rawmem(CreateSharedMemory(aSize, aType, false, (&(aId))));
844 0 : if ((!(rawmem))) {
845 0 : return false;
846 : }
847 :
848 0 : (*(aMem)) = Shmem(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead(), (rawmem).forget(), aId);
849 0 : return true;
850 : }
851 :
852 : bool
853 0 : PHttpChannelParent::AllocUnsafeShmem(
854 : size_t aSize,
855 : Shmem::SharedMemory::SharedMemoryType aType,
856 : Shmem* aMem)
857 : {
858 : Shmem::id_t aId;
859 0 : nsAutoPtr<Shmem::SharedMemory> rawmem(CreateSharedMemory(aSize, aType, true, (&(aId))));
860 0 : if ((!(rawmem))) {
861 0 : return false;
862 : }
863 :
864 0 : (*(aMem)) = Shmem(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead(), (rawmem).forget(), aId);
865 0 : return true;
866 : }
867 :
868 : bool
869 0 : PHttpChannelParent::AdoptShmem(
870 : Shmem& aMem,
871 : Shmem* aOutMem)
872 : {
873 0 : Shmem::SharedMemory* rawmem = (aMem).Segment(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead());
874 0 : if (((!(rawmem))) || (IsTrackingSharedMemory(rawmem))) {
875 0 : NS_RUNTIMEABORT("bad Shmem");
876 : }
877 :
878 : Shmem::id_t aId;
879 0 : if ((!(AdoptSharedMemory(rawmem, (&(aId)))))) {
880 0 : return false;
881 : }
882 :
883 0 : (*(aOutMem)) = Shmem(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead(), rawmem, aId);
884 0 : return true;
885 : }
886 :
887 : bool
888 0 : PHttpChannelParent::DeallocShmem(Shmem& aMem)
889 : {
890 0 : bool ok = DestroySharedMemory(aMem);
891 0 : (aMem).forget(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead());
892 0 : return ok;
893 : }
894 :
895 : void
896 0 : PHttpChannelParent::FatalError(const char* const msg) const
897 : {
898 : // Virtual method to prevent inlining.
899 : // This give us better error reporting.
900 : // See bug 589371
901 :
902 0 : NS_ERROR("IPDL error:");
903 0 : NS_ERROR(msg);
904 :
905 0 : NS_ERROR("[PHttpChannelParent] killing child side as a result");
906 :
907 0 : if ((!(base::KillProcess(OtherProcess(), base::PROCESS_END_KILLED_BY_USER, false)))) {
908 0 : NS_ERROR(" may have failed to kill child!");
909 : }
910 0 : }
911 :
912 : void
913 0 : PHttpChannelParent::DestroySubtree(ActorDestroyReason why)
914 : {
915 : // Unregister from our manager.
916 0 : Unregister(mId);
917 0 : mId = 1;
918 :
919 : // Finally, destroy "us".
920 0 : ActorDestroy(why);
921 0 : }
922 :
923 : void
924 0 : PHttpChannelParent::DeallocSubtree()
925 : {
926 0 : }
927 :
928 : void
929 0 : PHttpChannelParent::Write(
930 : PHttpChannelParent* __v,
931 : Message* __msg,
932 : bool __nullable)
933 : {
934 : int32 id;
935 0 : if ((!(__v))) {
936 0 : if ((!(__nullable))) {
937 0 : NS_RUNTIMEABORT("NULL actor value passed to non-nullable param");
938 : }
939 0 : id = 0;
940 : }
941 : else {
942 0 : id = (__v)->mId;
943 0 : if ((1) == (id)) {
944 0 : NS_RUNTIMEABORT("actor has been |delete|d");
945 : }
946 : }
947 :
948 0 : Write(id, __msg);
949 0 : }
950 :
951 : bool
952 0 : PHttpChannelParent::Read(
953 : PHttpChannelParent** __v,
954 : const Message* __msg,
955 : void** __iter,
956 : bool __nullable)
957 : {
958 : int32 id;
959 0 : if ((!(Read((&(id)), __msg, __iter)))) {
960 0 : return false;
961 : }
962 0 : if (((1) == (id)) || (((0) == (id)) && ((!(__nullable))))) {
963 0 : return false;
964 : }
965 :
966 0 : if ((0) == (id)) {
967 0 : (*(__v)) = 0;
968 : }
969 : else {
970 0 : (*(__v)) = static_cast<PHttpChannelParent*>(Lookup(id));
971 0 : if ((!((*(__v))))) {
972 0 : return false;
973 : }
974 : }
975 0 : return true;
976 : }
977 :
978 :
979 :
980 : } // namespace net
981 : } // namespace mozilla
|