1 /* vim: set sw=2 ts=8 et tw=80 : */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_net_ParentProcessDocumentChannel_h
8 #define mozilla_net_ParentProcessDocumentChannel_h
10 #include "mozilla/ipc/ProtocolUtils.h"
11 #include "mozilla/net/DocumentChannel.h"
12 #include "mozilla/net/DocumentLoadListener.h"
13 #include "nsIObserver.h"
14 #include "nsIAsyncVerifyRedirectCallback.h"
19 class EarlyHintConnectArgs
;
21 class ParentProcessDocumentChannel
: public DocumentChannel
,
22 public nsIAsyncVerifyRedirectCallback
,
25 ParentProcessDocumentChannel(nsDocShellLoadState
* aLoadState
,
26 class LoadInfo
* aLoadInfo
,
27 nsLoadFlags aLoadFlags
, uint32_t aCacheKey
,
29 bool aIsEmbeddingBlockedError
);
31 NS_DECL_ISUPPORTS_INHERITED
32 NS_DECL_NSIASYNCVERIFYREDIRECTCALLBACK
35 NS_IMETHOD
AsyncOpen(nsIStreamListener
* aListener
) override
;
36 NS_IMETHOD
Cancel(nsresult aStatusCode
) override
;
37 NS_IMETHOD
CancelWithReason(nsresult aStatusCode
,
38 const nsACString
& aReason
) override
;
40 RefPtr
<PDocumentChannelParent::RedirectToRealChannelPromise
>
41 RedirectToRealChannel(
42 nsTArray
<ipc::Endpoint
<extensions::PStreamFilterParent
>>&&
43 aStreamFilterEndpoints
,
44 uint32_t aRedirectFlags
, uint32_t aLoadFlags
,
45 const nsTArray
<EarlyHintConnectArgs
>& aEarlyHints
);
48 virtual ~ParentProcessDocumentChannel();
49 void RemoveObserver();
51 RefPtr
<DocumentLoadListener
> mDocumentLoadListener
;
52 nsTArray
<ipc::Endpoint
<extensions::PStreamFilterParent
>>
53 mStreamFilterEndpoints
;
54 MozPromiseHolder
<PDocumentChannelParent::RedirectToRealChannelPromise
>
56 bool mRequestObserversCalled
= false;
60 } // namespace mozilla
62 #endif // mozilla_net_ParentProcessDocumentChannel_h