LibWeb: Convert callers of ImageCodecPlugin to the async API

The HTMLLinkElement caller is a bit hairy, so we shove an await() in
there temporarily. This is sure to cause fun times for anyone debugging
task/microtask execution order.
This commit is contained in:
Andrew Kaster 2024-04-19 15:55:54 -06:00 committed by Andrew Kaster
commit 651e78fedb
Notes: sideshowbarker 2024-07-17 05:58:46 +09:00
7 changed files with 78 additions and 71 deletions

View file

@ -25,13 +25,4 @@ void ImageCodecPlugin::install(ImageCodecPlugin& plugin)
s_the = &plugin;
}
Optional<DecodedImage> ImageCodecPlugin::decode_image(ReadonlyBytes encoded_data)
{
auto promise = decode_image(encoded_data, {}, {});
auto result = promise->await();
if (result.is_error())
return {};
return result.release_value();
}
}