mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 08:04:57 +00:00
Ladybird+LibWebView+WebContent: Make the screenshot IPCs async
These IPCs are different than other IPCs in that we can't just set up a callback function to be invoked when WebContent sends us the screenshot data. There are multiple places that would set that callback, and they would step on each other's toes. Instead, the screenshot APIs on ViewImplementation now return a Promise which callers can interact with to receive the screenshot (or an error).
This commit is contained in:
parent
93db790974
commit
d8fa226a8f
13 changed files with 121 additions and 47 deletions
|
@ -231,6 +231,11 @@ void WebContentClient::did_get_dom_node_html(String const& html)
|
|||
m_view.on_received_dom_node_html(html);
|
||||
}
|
||||
|
||||
void WebContentClient::did_take_screenshot(Gfx::ShareableBitmap const& screenshot)
|
||||
{
|
||||
m_view.did_receive_screenshot({}, screenshot);
|
||||
}
|
||||
|
||||
void WebContentClient::did_output_js_console_message(i32 message_index)
|
||||
{
|
||||
if (m_view.on_received_console_message)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue