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_EmptyBlobImpl_h
8 #define mozilla_dom_EmptyBlobImpl_h
10 #include "BaseBlobImpl.h"
12 namespace mozilla::dom
{
14 class EmptyBlobImpl final
: public BaseBlobImpl
{
16 NS_INLINE_DECL_REFCOUNTING_INHERITED(EmptyBlobImpl
, BaseBlobImpl
)
19 explicit EmptyBlobImpl(const nsAString
& aContentType
)
20 : BaseBlobImpl(aContentType
, 0 /* aLength */) {}
22 void CreateInputStream(nsIInputStream
** aStream
,
23 ErrorResult
& aRv
) const override
;
25 already_AddRefed
<BlobImpl
> CreateSlice(uint64_t aStart
, uint64_t aLength
,
26 const nsAString
& aContentType
,
27 ErrorResult
& aRv
) const override
;
29 bool IsMemoryFile() const override
{ return true; }
31 void GetBlobImplType(nsAString
& aBlobImplType
) const override
{
32 aBlobImplType
= u
"EmptyBlobImpl"_ns
;
36 ~EmptyBlobImpl() override
= default;
39 } // namespace mozilla::dom
41 #endif // mozilla_dom_EmptyBlobImpl_h