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
,
28 bool aUriModified
, bool aIsXFOError
);
30 NS_DECL_ISUPPORTS_INHERITED
31 NS_DECL_NSIASYNCVERIFYREDIRECTCALLBACK
34 NS_IMETHOD
AsyncOpen(nsIStreamListener
* aListener
) override
;
35 NS_IMETHOD
Cancel(nsresult aStatusCode
) override
;
36 NS_IMETHOD
CancelWithReason(nsresult aStatusCode
,
37 const nsACString
& aReason
) override
;
39 RefPtr
<PDocumentChannelParent::RedirectToRealChannelPromise
>
40 RedirectToRealChannel(
41 nsTArray
<ipc::Endpoint
<extensions::PStreamFilterParent
>>&&
42 aStreamFilterEndpoints
,
43 uint32_t aRedirectFlags
, uint32_t aLoadFlags
,
44 const nsTArray
<EarlyHintConnectArgs
>& aEarlyHints
);
47 virtual ~ParentProcessDocumentChannel();
48 void RemoveObserver();
50 RefPtr
<DocumentLoadListener
> mDocumentLoadListener
;
51 nsTArray
<ipc::Endpoint
<extensions::PStreamFilterParent
>>
52 mStreamFilterEndpoints
;
53 MozPromiseHolder
<PDocumentChannelParent::RedirectToRealChannelPromise
>
55 bool mRequestObserversCalled
= false;
59 } // namespace mozilla
61 #endif // mozilla_net_ParentProcessDocumentChannel_h