diff options
author | Linus Groh <mail@linusgroh.de> | 2023-01-12 19:27:17 +0000 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2023-01-12 23:39:36 +0100 |
commit | 5411adca223a51edde731903828ae4cb39462880 (patch) | |
tree | c95b0f27311618a70ad27c0a8b86875263035385 /Ladybird | |
parent | 121181e392ddfe54194b4dd5493665f13a2ffe2b (diff) | |
download | serenity-5411adca223a51edde731903828ae4cb39462880.zip |
LibWebView+Ladybird: Begin de-duplicate WebView implementations
This starts moving code equally shared between the OOPWV and Ladybird
WebContentView implementations to WebView::ViewImplementation, beginning
with the client state.
Diffstat (limited to 'Ladybird')
-rw-r--r-- | Ladybird/WebContentView.cpp | 6 | ||||
-rw-r--r-- | Ladybird/WebContentView.h | 21 |
2 files changed, 3 insertions, 24 deletions
diff --git a/Ladybird/WebContentView.cpp b/Ladybird/WebContentView.cpp index e9a99b07ad..0c5f9964d3 100644 --- a/Ladybird/WebContentView.cpp +++ b/Ladybird/WebContentView.cpp @@ -607,12 +607,6 @@ void WebContentView::hideEvent(QHideEvent* event) client().async_set_system_visibility_state(false); } -WebContentClient& WebContentView::client() -{ - VERIFY(m_client_state.client); - return *m_client_state.client; -} - void WebContentView::create_client() { m_client_state = {}; diff --git a/Ladybird/WebContentView.h b/Ladybird/WebContentView.h index d09d9ffa4f..058c31ed77 100644 --- a/Ladybird/WebContentView.h +++ b/Ladybird/WebContentView.h @@ -190,6 +190,9 @@ private: static constexpr auto ZOOM_MAX_LEVEL = 5.0f; static constexpr auto ZOOM_STEP = 0.1f; + // ^WebView::ViewImplementation + virtual void create_client() override; + void request_repaint(); void update_viewport_rect(); void handle_resize(); @@ -216,28 +219,10 @@ private: Gfx::IntRect m_viewport_rect; - void create_client(); - WebContentClient& client(); - void handle_web_content_process_crash(); AK::URL m_url; - struct SharedBitmap { - i32 id { -1 }; - i32 pending_paints { 0 }; - RefPtr<Gfx::Bitmap> bitmap; - }; - - struct ClientState { - RefPtr<WebContentClient> client; - SharedBitmap front_bitmap; - SharedBitmap back_bitmap; - i32 next_bitmap_id { 0 }; - bool has_usable_bitmap { false }; - bool got_repaint_requests_while_painting { false }; - } m_client_state; - RefPtr<Gfx::Bitmap> m_backup_bitmap; StringView m_webdriver_content_ipc_path; |