1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:57:35 +00:00

LibWebView: Add abstract virtual base for WebView implementations

This patch adds WebView::ViewImplementation with all the
`notify_server_did_this_or_that()` functions from OOPWV.

This will allow us to share code between different web views, paving the
way for a Qt widget in Ladybird that can talk to a WebContent process.
This commit is contained in:
Andreas Kling 2022-10-05 14:32:17 +02:00
parent d652794862
commit ceccc2c163
5 changed files with 102 additions and 40 deletions

View file

@ -14,7 +14,7 @@
namespace WebView {
class OutOfProcessWebView;
class ViewImplementation;
class WebContentClient final
: public IPC::ConnectionToServer<WebContentClientEndpoint, WebContentServerEndpoint>
@ -22,11 +22,11 @@ class WebContentClient final
IPC_CLIENT_CONNECTION(WebContentClient, "/tmp/session/%sid/portal/webcontent"sv);
public:
WebContentClient(NonnullOwnPtr<Core::Stream::LocalSocket>, ViewImplementation&);
Function<void()> on_web_content_process_crash;
private:
WebContentClient(NonnullOwnPtr<Core::Stream::LocalSocket>, OutOfProcessWebView&);
virtual void die() override;
virtual void did_paint(Gfx::IntRect const&, i32) override;
@ -63,7 +63,7 @@ private:
virtual void did_update_resource_count(i32 count_waiting) override;
virtual void did_request_file(String const& path, i32) override;
OutOfProcessWebView& m_view;
ViewImplementation& m_view;
};
}