mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-30 13:19:47 +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:
committed by
Andreas Kling
parent
93db790974
commit
d8fa226a8f
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user