Bug 1873666 [wpt PR 43897] - Add VideoTrackGenerator IDL tests, a=testonly
[gecko.git] / netwerk / ipc / ParentProcessDocumentChannel.h
blobf9b4ad616de6ae2e24c143ed8a559220311582d1
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"
16 namespace mozilla {
17 namespace net {
19 class EarlyHintConnectArgs;
21 class ParentProcessDocumentChannel : public DocumentChannel,
22 public nsIAsyncVerifyRedirectCallback,
23 public nsIObserver {
24 public:
25 ParentProcessDocumentChannel(nsDocShellLoadState* aLoadState,
26 class LoadInfo* aLoadInfo,
27 nsLoadFlags aLoadFlags, uint32_t aCacheKey,
28 bool aUriModified,
29 bool aIsEmbeddingBlockedError);
31 NS_DECL_ISUPPORTS_INHERITED
32 NS_DECL_NSIASYNCVERIFYREDIRECTCALLBACK
33 NS_DECL_NSIOBSERVER
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);
47 private:
48 virtual ~ParentProcessDocumentChannel();
49 void RemoveObserver();
51 RefPtr<DocumentLoadListener> mDocumentLoadListener;
52 nsTArray<ipc::Endpoint<extensions::PStreamFilterParent>>
53 mStreamFilterEndpoints;
54 MozPromiseHolder<PDocumentChannelParent::RedirectToRealChannelPromise>
55 mPromise;
56 bool mRequestObserversCalled = false;
59 } // namespace net
60 } // namespace mozilla
62 #endif // mozilla_net_ParentProcessDocumentChannel_h