BinaryHttpRequest.h (1538B)
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* vim: set sw=2 ts=8 et tw=80 : */ 3 4 /* This Source Code Form is subject to the terms of the Mozilla Public 5 * License, v. 2.0. If a copy of the MPL was not distributed with this 6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 7 8 #ifndef mozilla_net_BinaryHttpRequest_h 9 #define mozilla_net_BinaryHttpRequest_h 10 11 #include "nsIBinaryHttp.h" 12 #include "nsString.h" 13 14 namespace mozilla::net { 15 16 class BinaryHttpRequest final : public nsIBinaryHttpRequest { 17 public: 18 NS_DECL_THREADSAFE_ISUPPORTS 19 NS_DECL_NSIBINARYHTTPREQUEST 20 21 BinaryHttpRequest(const nsACString& aMethod, const nsACString& aScheme, 22 const nsACString& aAuthority, const nsACString& aPath, 23 nsTArray<nsCString>&& aHeaderNames, 24 nsTArray<nsCString>&& aHeaderValues, 25 nsTArray<uint8_t>&& aContent) 26 : mMethod(aMethod), 27 mScheme(aScheme), 28 mAuthority(aAuthority), 29 mPath(aPath), 30 mHeaderNames(std::move(aHeaderNames)), 31 mHeaderValues(std::move(aHeaderValues)), 32 mContent(std::move(aContent)) {} 33 34 private: 35 ~BinaryHttpRequest() = default; 36 37 const nsAutoCString mMethod; 38 const nsAutoCString mScheme; 39 const nsAutoCString mAuthority; 40 const nsAutoCString mPath; 41 const nsTArray<nsCString> mHeaderNames; 42 const nsTArray<nsCString> mHeaderValues; 43 const nsTArray<uint8_t> mContent; 44 }; 45 46 } // namespace mozilla::net 47 48 #endif // mozilla_net_BinaryHttpRequest_h