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 DOM_FS_FILESYSTEMWRITABLEFILESTREAM_H_
8 #define DOM_FS_FILESYSTEMWRITABLEFILESTREAM_H_
10 #include "mozilla/dom/WritableStream.h"
12 namespace mozilla::dom
{
14 class ArrayBufferViewOrArrayBufferOrBlobOrUSVStringOrWriteParams
;
16 class FileSystemWritableFileStream final
: public WritableStream
{
18 NS_DECL_ISUPPORTS_INHERITED
19 NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(FileSystemWritableFileStream
,
23 JSObject
* WrapObject(JSContext
* aCx
,
24 JS::Handle
<JSObject
*> aGivenProto
) override
;
27 already_AddRefed
<Promise
> Write(
28 const ArrayBufferViewOrArrayBufferOrBlobOrUSVStringOrWriteParams
& aData
);
30 already_AddRefed
<Promise
> Seek(uint64_t aPosition
);
32 already_AddRefed
<Promise
> Truncate(uint64_t aSize
);
35 ~FileSystemWritableFileStream() = default;
38 } // namespace mozilla::dom
40 #endif // DOM_FS_FILESYSTEMWRITABLEFILESTREAM_H_