mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:37:37 +00:00
LibWeb: Add public get accessor function for Blob's internal ByteBuffer
Blob::bytes() returns the ReadonlyBytes representation of our internal ByteBuffer. This change requires us to ByteBuffer::copy() Blob's ReadonlyBytes to a ByteBuffer in XHR::send() and corresponding error handling of the copy operation. This removes the need for Blob to declare XMLHttpRequest as a friend class.
This commit is contained in:
parent
417a385db1
commit
622a4f29a7
3 changed files with 16 additions and 7 deletions
|
@ -48,14 +48,14 @@ public:
|
|||
|
||||
virtual JS::Object* create_wrapper(JS::GlobalObject&);
|
||||
|
||||
ReadonlyBytes bytes() const { return m_byte_buffer.bytes(); }
|
||||
|
||||
private:
|
||||
Blob() = default;
|
||||
static ErrorOr<ByteBuffer> process_blob_parts(Vector<BlobPart> const& blob_parts);
|
||||
|
||||
ByteBuffer m_byte_buffer {};
|
||||
String m_type {};
|
||||
|
||||
friend class XHR::XMLHttpRequest;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue