/work/obj-fuzz/dist/include/ByteStream.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* This Source Code Form is subject to the terms of the Mozilla Public |
2 | | * License, v. 2.0. If a copy of the MPL was not distributed with this |
3 | | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
4 | | |
5 | | #ifndef STREAM_H_ |
6 | | #define STREAM_H_ |
7 | | |
8 | | #include "DecoderDoctorLogger.h" |
9 | | #include "nsISupportsImpl.h" |
10 | | |
11 | | namespace mozilla { |
12 | | |
13 | | DDLoggedTypeDeclName(ByteStream); |
14 | | |
15 | | class ByteStream : public DecoderDoctorLifeLogger<ByteStream> |
16 | | { |
17 | | public: |
18 | | NS_INLINE_DECL_THREADSAFE_REFCOUNTING(ByteStream); |
19 | | |
20 | | virtual bool ReadAt(int64_t offset, void* data, size_t size, |
21 | | size_t* bytes_read) = 0; |
22 | | virtual bool CachedReadAt(int64_t offset, void* data, size_t size, |
23 | | size_t* bytes_read) = 0; |
24 | | virtual bool Length(int64_t* size) = 0; |
25 | | |
26 | 0 | virtual void DiscardBefore(int64_t offset) {} |
27 | | |
28 | | protected: |
29 | 0 | virtual ~ByteStream() {} |
30 | | }; |
31 | | |
32 | | } |
33 | | |
34 | | #endif |