mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 19:59:17 +00:00
LibWeb: Implement FileReaderSync
interface
This interface allows the user to read File or Blob objects synchronously from inside workers.
This commit is contained in:
parent
3f71907255
commit
bbcd8bd97c
Notes:
github-actions[bot]
2025-02-28 04:50:48 +00:00
Author: https://github.com/tcl3
Commit: bbcd8bd97c
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3667
Reviewed-by: https://github.com/shannonbooth
6 changed files with 170 additions and 9 deletions
|
@ -81,6 +81,14 @@ public:
|
|||
void set_onloadend(WebIDL::CallbackType*);
|
||||
WebIDL::CallbackType* onloadend();
|
||||
|
||||
enum class Type {
|
||||
ArrayBuffer,
|
||||
BinaryString,
|
||||
Text,
|
||||
DataURL,
|
||||
};
|
||||
static WebIDL::ExceptionOr<Result> blob_package_data(JS::Realm& realm, ByteBuffer, FileReader::Type type, Optional<String> const&, Optional<String> const& encoding_name = {});
|
||||
|
||||
protected:
|
||||
FileReader(JS::Realm&, ByteBuffer);
|
||||
|
||||
|
@ -91,17 +99,8 @@ protected:
|
|||
private:
|
||||
explicit FileReader(JS::Realm&);
|
||||
|
||||
enum class Type {
|
||||
ArrayBuffer,
|
||||
BinaryString,
|
||||
Text,
|
||||
DataURL,
|
||||
};
|
||||
|
||||
WebIDL::ExceptionOr<void> read_operation(Blob&, Type, Optional<String> const& encoding_name = {});
|
||||
|
||||
static WebIDL::ExceptionOr<Result> blob_package_data(JS::Realm& realm, ByteBuffer, FileReader::Type type, Optional<String> const&, Optional<String> const& encoding_name);
|
||||
|
||||
void queue_a_task(GC::Ref<GC::Function<void()>>);
|
||||
|
||||
// Internal state to handle aborting the FileReader.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue