1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set sw=2 ts=8 et tw=80 : */
4 /* This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
8 #ifndef mozilla_net_DocumentChannelChild_h
9 #define mozilla_net_DocumentChannelChild_h
11 #include "mozilla/net/PDocumentChannelChild.h"
12 #include "mozilla/net/DocumentChannel.h"
13 #include "nsIAsyncVerifyRedirectCallback.h"
14 #include "mozilla/dom/nsCSPContext.h"
20 * DocumentChannelChild is an implementation of DocumentChannel for nsDocShells
21 * in the content process, that uses PDocumentChannel to serialize everything
22 * across IPDL to the parent process.
24 class DocumentChannelChild final
: public DocumentChannel
,
25 public nsIAsyncVerifyRedirectCallback
,
26 public PDocumentChannelChild
{
28 DocumentChannelChild(nsDocShellLoadState
* aLoadState
,
29 class LoadInfo
* aLoadInfo
, nsLoadFlags aLoadFlags
,
30 uint32_t aCacheKey
, bool aUriModified
,
31 bool aIsEmbeddingBlockedError
);
33 NS_DECL_ISUPPORTS_INHERITED
34 NS_DECL_NSIASYNCVERIFYREDIRECTCALLBACK
36 NS_IMETHOD
AsyncOpen(nsIStreamListener
* aListener
) override
;
37 NS_IMETHOD
Cancel(nsresult aStatusCode
) override
;
38 NS_IMETHOD
CancelWithReason(nsresult aStatusCode
,
39 const nsACString
& aReason
) override
;
41 mozilla::ipc::IPCResult
RecvFailedAsyncOpen(const nsresult
& aStatusCode
);
43 mozilla::ipc::IPCResult
RecvDisconnectChildListeners(
44 const nsresult
& aStatus
, const nsresult
& aLoadGroupStatus
,
45 bool aSwitchedProcess
);
47 mozilla::ipc::IPCResult
RecvDeleteSelf();
49 mozilla::ipc::IPCResult
RecvRedirectToRealChannel(
50 RedirectToRealChannelArgs
&& aArgs
,
51 nsTArray
<Endpoint
<extensions::PStreamFilterParent
>>&& aEndpoints
,
52 RedirectToRealChannelResolver
&& aResolve
);
54 mozilla::ipc::IPCResult
RecvUpgradeObjectLoad(
55 UpgradeObjectLoadResolver
&& aResolve
);
58 void DeleteIPDL() override
{
64 ~DocumentChannelChild();
66 nsCOMPtr
<nsIChannel
> mRedirectChannel
;
68 RedirectToRealChannelResolver mRedirectResolver
;
69 nsTArray
<Endpoint
<extensions::PStreamFilterParent
>> mStreamFilterEndpoints
;
70 dom::BrowsingContext
* mLoadingContext
;
74 } // namespace mozilla
76 #endif // mozilla_net_DocumentChannelChild_h