LibWeb: Add ResourceLoader::load_sync()

This function creates a nested event loop and runs a load() operation
inside it, returning only once the load has either succeeded or failed.

This will be used to implement blocking loads (ew!)
This commit is contained in:
Andreas Kling 2020-04-03 22:58:05 +02:00
commit 18d45d1082
Notes: sideshowbarker 2024-07-19 07:58:08 +09:00
2 changed files with 20 additions and 0 deletions

View file

@ -42,6 +42,7 @@ public:
static ResourceLoader& the();
void load(const URL&, Function<void(const ByteBuffer&)> success_callback, Function<void(const String&)> error_callback = nullptr);
void load_sync(const URL&, Function<void(const ByteBuffer&)> success_callback, Function<void(const String&)> error_callback = nullptr);
Function<void()> on_load_counter_change;