mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 18:20:43 +09:00
AK: Stop using DeprecatedString
in Base64 encoding
This commit is contained in:
parent
99c1b634fc
commit
25f2e4981c
Notes:
sideshowbarker
2024-07-17 05:23:40 +09:00
Author: https://github.com/gmta
Commit: 25f2e4981c
Pull-request: https://github.com/SerenityOS/serenity/pull/16580
Reviewed-by: https://github.com/ADKaster
Reviewed-by: https://github.com/Hendiadyoin1
14 changed files with 47 additions and 27 deletions
|
@ -181,7 +181,12 @@ DeprecatedString HTMLCanvasElement::to_data_url(DeprecatedString const& type, [[
|
|||
dbgln("Gfx::PNGWriter failed to encode the HTMLCanvasElement: {}", encoded_bitmap_or_error.error());
|
||||
return {};
|
||||
}
|
||||
return AK::URL::create_with_data(type, encode_base64(encoded_bitmap_or_error.value()), true).to_deprecated_string();
|
||||
auto base64_encoded_or_error = encode_base64(encoded_bitmap_or_error.value());
|
||||
if (base64_encoded_or_error.is_error()) {
|
||||
// FIXME: propagate error
|
||||
return {};
|
||||
}
|
||||
return AK::URL::create_with_data(type, base64_encoded_or_error.release_value().to_deprecated_string(), true).to_deprecated_string();
|
||||
}
|
||||
|
||||
void HTMLCanvasElement::present()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue