Bug 1845134 - Part 4: Update existing ui-icons to use the latest source from acorn...
[gecko.git] / netwerk / base / ArrayBufferInputStream.h
blobe3d4ea62f05d497a3eaa3496a2d8d883e1e10793
1 /* -*- Mode: C++; tab-width: 4; 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/. */
6 #ifndef ArrayBufferInputStream_h
7 #define ArrayBufferInputStream_h
9 #include "nsIArrayBufferInputStream.h"
10 #include "js/Value.h"
11 #include "mozilla/Maybe.h"
12 #include "mozilla/UniquePtr.h"
13 #include "nsISupportsImpl.h"
15 #define NS_ARRAYBUFFERINPUTSTREAM_CONTRACTID \
16 "@mozilla.org/io/arraybuffer-input-stream;1"
17 #define NS_ARRAYBUFFERINPUTSTREAM_CID \
18 { /* 3014dde6-aa1c-41db-87d0-48764a3710f6 */ \
19 0x3014dde6, 0xaa1c, 0x41db, { \
20 0x87, 0xd0, 0x48, 0x76, 0x4a, 0x37, 0x10, 0xf6 \
21 } \
24 class ArrayBufferInputStream : public nsIArrayBufferInputStream {
25 public:
26 ArrayBufferInputStream() = default;
28 NS_DECL_THREADSAFE_ISUPPORTS
29 NS_DECL_NSIARRAYBUFFERINPUTSTREAM
30 NS_DECL_NSIINPUTSTREAM
32 private:
33 virtual ~ArrayBufferInputStream() = default;
34 mozilla::UniquePtr<uint8_t[]> mArrayBuffer;
35 uint32_t mBufferLength{0};
36 uint32_t mPos{0};
37 bool mClosed{false};
40 #endif // ArrayBufferInputStream_h