mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 15:37:46 +00:00
AK+Libraries: Remove FixedMemoryStream::[readonly_]bytes()
These methods are slightly more convenient than storing the Bytes separately. However, it it feels unsanitary to reach in and access this data directly. Both of the users of these already have the [Readonly]Bytes available in their constructors, and can easily avoid using these methods, so let's remove them entirely.
This commit is contained in:
parent
109ea418ab
commit
3f7d97f098
4 changed files with 12 additions and 19 deletions
|
@ -46,6 +46,7 @@ public:
|
|||
Vector2D<FrameBlockContext>& contexts)
|
||||
{
|
||||
return FrameContext(
|
||||
data,
|
||||
TRY(try_make<FixedMemoryStream>(data)),
|
||||
TRY(try_make<SyntaxElementCounter>()),
|
||||
contexts);
|
||||
|
@ -54,12 +55,12 @@ public:
|
|||
FrameContext(FrameContext const&) = delete;
|
||||
FrameContext(FrameContext&&) = default;
|
||||
|
||||
ReadonlyBytes stream_data;
|
||||
NonnullOwnPtr<FixedMemoryStream> stream;
|
||||
BigEndianInputBitStream bit_stream;
|
||||
|
||||
DecoderErrorOr<BooleanDecoder> create_range_decoder(size_t size)
|
||||
{
|
||||
ReadonlyBytes stream_data = stream->readonly_bytes();
|
||||
auto compressed_header_data = ReadonlyBytes(stream_data.data() + stream->offset(), size);
|
||||
|
||||
// 9.2.1: The Boolean decoding process specified in section 9.2.2 is invoked to read a marker syntax element from the
|
||||
|
@ -178,10 +179,12 @@ public:
|
|||
private:
|
||||
friend struct TileContext;
|
||||
|
||||
FrameContext(NonnullOwnPtr<FixedMemoryStream> stream,
|
||||
FrameContext(ReadonlyBytes data,
|
||||
NonnullOwnPtr<FixedMemoryStream> stream,
|
||||
NonnullOwnPtr<SyntaxElementCounter> counter,
|
||||
Vector2D<FrameBlockContext>& contexts)
|
||||
: stream(move(stream))
|
||||
: stream_data(data)
|
||||
, stream(move(stream))
|
||||
, bit_stream(MaybeOwned<Stream>(*this->stream))
|
||||
, counter(move(counter))
|
||||
, m_block_contexts(contexts)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue