1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 09:08:12 +00:00
serenity/Userland/Services/WebContent/WebContentClient.ipc
Timothy Flynn 8b32f4ae7a LibWebView+WebContent: Let the WebView client broadcast when it painted
When the WebContent process has painted to its shared bitmaps, it sends
a synchronous IPC to the browser process to let the chrome paint. It is
synchronous to ensure the WC process doesn't paint onto the backing
bitmap again while it is being displayed.

However, this can cause a crash at exit if the browser process quits
while the WC process is waiting for a response to this IPC.

This patch makes the painting logic asynchronous by letting the browser
process broadcast when it has finished handling the paint IPC. The WC
process will not paint anything again until it receives that message. If
it had tried to repaint while waiting for that message, that paint will
be deferred until it arrives.
2024-01-08 00:51:59 +01:00

90 lines
4.8 KiB
Text

#include <AK/URL.h>
#include <LibCore/AnonymousBuffer.h>
#include <LibGfx/Color.h>
#include <LibGfx/ShareableBitmap.h>
#include <LibWeb/Cookie/Cookie.h>
#include <LibWeb/Cookie/ParsedCookie.h>
#include <LibWeb/CSS/Selector.h>
#include <LibWeb/HTML/ActivateTab.h>
#include <LibWeb/HTML/SelectItem.h>
#include <LibWeb/Page/Page.h>
#include <LibWebView/Attribute.h>
endpoint WebContentClient
{
did_start_loading(URL url, bool is_redirect) =|
did_finish_loading(URL url) =|
did_request_navigate_back() =|
did_request_navigate_forward() =|
did_request_refresh() =|
did_paint(Gfx::IntRect content_rect, i32 bitmap_id) =|
did_request_cursor_change(i32 cursor_type) =|
did_layout(Gfx::IntSize content_size) =|
did_change_title(ByteString title) =|
did_request_scroll(i32 x_delta, i32 y_delta) =|
did_request_scroll_to(Gfx::IntPoint scroll_position) =|
did_enter_tooltip_area(Gfx::IntPoint content_position, ByteString title) =|
did_leave_tooltip_area() =|
did_hover_link(URL url) =|
did_unhover_link() =|
did_click_link(URL url, ByteString target, unsigned modifiers) =|
did_middle_click_link(URL url, ByteString target, unsigned modifiers) =|
did_request_context_menu(Gfx::IntPoint content_position) =|
did_request_link_context_menu(Gfx::IntPoint content_position, URL url, ByteString target, unsigned modifiers) =|
did_request_image_context_menu(Gfx::IntPoint content_position, URL url, ByteString target, unsigned modifiers, Gfx::ShareableBitmap bitmap) =|
did_request_media_context_menu(Gfx::IntPoint content_position, ByteString target, unsigned modifiers, Web::Page::MediaContextMenu menu) =|
did_request_alert(String message) =|
did_request_confirm(String message) =|
did_request_prompt(String message, String default_) =|
did_request_set_prompt_text(String message) =|
did_request_accept_dialog() =|
did_request_dismiss_dialog() =|
did_get_source(URL url, ByteString source) =|
did_inspect_dom_tree(ByteString dom_tree) =|
did_inspect_dom_node(bool has_style, ByteString computed_style, ByteString resolved_style, ByteString custom_properties, ByteString node_box_sizing, ByteString aria_properties_state) =|
did_inspect_accessibility_tree(ByteString accessibility_tree) =|
did_get_hovered_node_id(i32 node_id) =|
did_finish_editing_dom_node(Optional<i32> node_id) =|
did_get_dom_node_html(String html) =|
did_take_screenshot(Gfx::ShareableBitmap screenshot) =|
did_change_favicon(Gfx::ShareableBitmap favicon) =|
did_request_all_cookies(URL url) => (Vector<Web::Cookie::Cookie> cookies)
did_request_named_cookie(URL url, ByteString name) => (Optional<Web::Cookie::Cookie> cookie)
did_request_cookie(URL url, u8 source) => (ByteString cookie)
did_set_cookie(URL url, Web::Cookie::ParsedCookie cookie, u8 source) =|
did_update_cookie(Web::Cookie::Cookie cookie) =|
did_update_resource_count(i32 count_waiting) =|
did_request_new_tab(Web::HTML::ActivateTab activate_tab) => (String handle)
did_request_activate_tab() =|
did_close_browsing_context() =|
did_request_restore_window() =|
did_request_reposition_window(Gfx::IntPoint position) => (Gfx::IntPoint window_position)
did_request_resize_window(Gfx::IntSize size) => (Gfx::IntSize window_size)
did_request_maximize_window() => (Gfx::IntRect window_rect)
did_request_minimize_window() => (Gfx::IntRect window_rect)
did_request_fullscreen_window() => (Gfx::IntRect window_rect)
did_request_file(ByteString path, i32 request_id) =|
did_request_color_picker(Color current_color) =|
did_request_select_dropdown(Gfx::IntPoint content_position, i32 minimum_width, Vector<Web::HTML::SelectItem> items) =|
did_finish_handling_input_event(bool event_was_accepted) =|
did_change_theme_color(Gfx::Color color) =|
did_insert_clipboard_entry(String data, String presentation_style, String mime_type) =|
did_output_js_console_message(i32 message_index) =|
did_get_js_console_messages(i32 start_index, Vector<ByteString> message_types, Vector<ByteString> messages) =|
did_finish_text_test() =|
inspector_did_load() =|
inspector_did_select_dom_node(i32 node_id, Optional<Web::CSS::Selector::PseudoElement::Type> pseudo_element) =|
inspector_did_set_dom_node_text(i32 node_id, String text) =|
inspector_did_set_dom_node_tag(i32 node_id, String tag) =|
inspector_did_add_dom_node_attributes(i32 node_id, Vector<WebView::Attribute> attributes) =|
inspector_did_replace_dom_node_attribute(i32 node_id, String name, Vector<WebView::Attribute> replacement_attributes) =|
inspector_did_request_dom_tree_context_menu(i32 node_id, Gfx::IntPoint position, String type, Optional<String> tag, Optional<WebView::Attribute> attribute) =|
inspector_did_execute_console_script(String script) =|
}