nsDataChannel.h (1239B)
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 // data implementation header 7 8 #ifndef nsDataChannel_h___ 9 #define nsDataChannel_h___ 10 11 #include "nsBaseChannel.h" 12 #include "nsIChildChannel.h" 13 #include "nsIDataChannel.h" 14 15 class nsIInputStream; 16 17 class nsDataChannel : public nsBaseChannel, 18 public nsIDataChannel, 19 public nsIIdentChannel, 20 public nsIChildChannel { 21 public: 22 NS_DECL_ISUPPORTS_INHERITED 23 NS_DECL_NSIDATACHANNEL 24 NS_FORWARD_NSIREQUEST(nsBaseChannel::) 25 NS_FORWARD_NSICHANNEL(nsBaseChannel::) 26 NS_DECL_NSIIDENTCHANNEL 27 NS_DECL_NSICHILDCHANNEL 28 29 explicit nsDataChannel(nsIURI* uri) { SetURI(uri); } 30 31 nsresult Init(); 32 33 protected: 34 virtual ~nsDataChannel() = default; 35 [[nodiscard]] virtual nsresult OpenContentStream( 36 bool async, nsIInputStream** result, nsIChannel** channel) override; 37 uint64_t mChannelId = 0; 38 39 private: 40 nsresult MaybeSendDataChannelOpenNotification(); 41 }; 42 43 #endif /* nsDataChannel_h___ */