tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

ParentProcessDocumentChannel.h (2204B)


      1 /* vim: set sw=2 ts=8 et tw=80 : */
      2 
      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/. */
      6 
      7 #ifndef mozilla_net_ParentProcessDocumentChannel_h
      8 #define mozilla_net_ParentProcessDocumentChannel_h
      9 
     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"
     15 
     16 namespace mozilla {
     17 namespace net {
     18 
     19 class EarlyHintConnectArgs;
     20 
     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);
     30 
     31  NS_DECL_ISUPPORTS_INHERITED
     32  NS_DECL_NSIASYNCVERIFYREDIRECTCALLBACK
     33  NS_DECL_NSIOBSERVER
     34 
     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;
     39 
     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);
     46 
     47 private:
     48  virtual ~ParentProcessDocumentChannel();
     49  void RemoveObserver();
     50 
     51  RefPtr<DocumentLoadListener> mDocumentLoadListener;
     52  nsTArray<ipc::Endpoint<extensions::PStreamFilterParent>>
     53      mStreamFilterEndpoints;
     54  MozPromiseHolder<PDocumentChannelParent::RedirectToRealChannelPromise>
     55      mPromise;
     56  bool mRequestObserversCalled = false;
     57 };
     58 
     59 }  // namespace net
     60 }  // namespace mozilla
     61 
     62 #endif  // mozilla_net_ParentProcessDocumentChannel_h