Bug 1700051: part 26) Correct typo in comment of `mozInlineSpellWordUtil::BuildSoftTe...
[gecko.git] / dom / fetch / EmptyBody.h
blobdce71d4ae278d249fd2eac890a74bffa3a3a565c
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 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_dom_EmptyBody_h
8 #define mozilla_dom_EmptyBody_h
10 #include "nsISupportsImpl.h"
12 #include "mozilla/dom/Fetch.h"
14 namespace mozilla {
16 namespace ipc {
17 class PrincipalInfo;
18 } // namespace ipc
20 namespace dom {
22 class EmptyBody final : public FetchBody<EmptyBody> {
23 NS_DECL_ISUPPORTS_INHERITED
24 NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(EmptyBody,
25 FetchBody<EmptyBody>)
27 public:
28 static already_AddRefed<EmptyBody> Create(
29 nsIGlobalObject* aGlobal, mozilla::ipc::PrincipalInfo* aPrincipalInfo,
30 AbortSignalImpl* aAbortSignalImpl, const nsACString& aMimeType,
31 ErrorResult& aRv);
33 nsIGlobalObject* GetParentObject() const { return mOwner; }
35 AbortSignalImpl* GetSignalImpl() const override { return mAbortSignalImpl; }
37 const UniquePtr<mozilla::ipc::PrincipalInfo>& GetPrincipalInfo() const {
38 return mPrincipalInfo;
41 void GetMimeType(nsACString& aMimeType) { aMimeType = mMimeType; }
43 void GetBody(nsIInputStream** aStream, int64_t* aBodyLength = nullptr);
45 using FetchBody::BodyBlobURISpec;
47 const nsACString& BodyBlobURISpec() const { return EmptyCString(); }
49 using FetchBody::BodyLocalPath;
51 const nsAString& BodyLocalPath() const { return EmptyString(); }
53 private:
54 EmptyBody(nsIGlobalObject* aGlobal,
55 mozilla::ipc::PrincipalInfo* aPrincipalInfo,
56 AbortSignalImpl* aAbortSignalImpl, const nsACString& aMimeType,
57 already_AddRefed<nsIInputStream> mBodyStream);
59 ~EmptyBody();
61 UniquePtr<mozilla::ipc::PrincipalInfo> mPrincipalInfo;
62 RefPtr<AbortSignalImpl> mAbortSignalImpl;
63 nsCString mMimeType;
64 nsCOMPtr<nsIInputStream> mBodyStream;
67 } // namespace dom
68 } // namespace mozilla
70 #endif // mozilla_dom_EmptyBody_h