tor-browser

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

nsInputStreamChannel.h (1322B)


      1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
      2 /* This Source Code Form is subject to the terms of the Mozilla Public
      3 * License, v. 2.0. If a copy of the MPL was not distributed with this
      4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      5 
      6 #ifndef nsInputStreamChannel_h__
      7 #define nsInputStreamChannel_h__
      8 
      9 #include "nsBaseChannel.h"
     10 #include "nsIInputStreamChannel.h"
     11 
     12 //-----------------------------------------------------------------------------
     13 
     14 namespace mozilla {
     15 namespace net {
     16 
     17 class nsInputStreamChannel : public nsBaseChannel,
     18                             public nsIInputStreamChannel {
     19 public:
     20  NS_DECL_ISUPPORTS_INHERITED
     21  NS_DECL_NSIINPUTSTREAMCHANNEL
     22 
     23  nsInputStreamChannel() = default;
     24 
     25  NS_IMETHOD SetContentType(const nsACString& aContentType) override;
     26 
     27 protected:
     28  virtual ~nsInputStreamChannel() = default;
     29 
     30  virtual nsresult OpenContentStream(bool async, nsIInputStream** result,
     31                                     nsIChannel** channel) override;
     32 
     33  virtual void OnChannelDone() override { mContentStream = nullptr; }
     34 
     35 private:
     36  nsCOMPtr<nsIInputStream> mContentStream;
     37  nsCOMPtr<nsIURI> mBaseURI;
     38  nsString mSrcdocData;
     39  bool mIsSrcdocChannel{false};
     40 };
     41 
     42 }  // namespace net
     43 }  // namespace mozilla
     44 
     45 #endif  // !nsInputStreamChannel_h__