2024-06-30 01:24:01 -03:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2024, Andrew Kaster <akaster@serenityos.org>
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2024-08-28 16:29:51 -03:00
|
|
|
#include <AK/ByteString.h>
|
2026-03-22 15:59:08 -03:00
|
|
|
#include <AK/Function.h>
|
2024-08-28 16:29:51 -03:00
|
|
|
#include <AK/LexicalPath.h>
|
|
|
|
|
#include <AK/Optional.h>
|
2026-05-21 12:46:17 -03:00
|
|
|
#include <LibCore/AnonymousBuffer.h>
|
2024-06-30 01:24:01 -03:00
|
|
|
#include <LibCore/EventLoop.h>
|
2024-08-24 13:15:20 -03:00
|
|
|
#include <LibCore/Forward.h>
|
2025-10-07 15:35:22 -03:00
|
|
|
#include <LibDatabase/Forward.h>
|
2025-02-15 10:09:47 -03:00
|
|
|
#include <LibDevTools/DevToolsDelegate.h>
|
|
|
|
|
#include <LibDevTools/Forward.h>
|
LibWebView+WebContent: Add feature-gated Compositor process backend
We are moving toward an architecture where the browser owns a single
process that holds the GPU context, so Skia resources can be shared
across every renderer and WebContent processes can be sandboxed away
from direct GPU access. A dedicated Compositor helper process is the
first step. The earlier commits laid the foundation; this one turns the
helper on as a selectable backend, gated behind
--enable-compositor-process so the existing in-process path stays the
shipping default.
Default topology -- one compositor per WebContent, in-process:
+---------+
| Browser |
+---------+
/ | \
v v v
+---+ +---+ +---+ each WebContent runs its own
|WC | |WC | |WC | CompositorThread on a dedicated
|+C+| |+C+| |+C+| thread, with its own GPU context.
+---+ +---+ +---+
Opt-in topology -- one single-threaded Compositor, shared by all WCs:
+---------+ control +-------------------+
| Browser |<----------->| Compositor |
+---------+ | (single thread, |
/ | \ | single GPU ctx, |
v v v data | shared by all |
[WC] [WC] [WC] ---------->| connected WCs) |
+-------------------+
Three IPC channels carry the work in the opt-in topology. The
existing Browser<->WebContent channel gains context allocation.
A new Browser<->Compositor channel carries context lifetime,
viewport, UI input, and presentation acks plus backing-store and
frame upcalls. A new WebContent<->Compositor channel carries
display lists, scroll state, video, compositor surfaces, async
scrolling, presentation, and screenshots, with upcalls for
delegated input and compositor loss.
2026-05-22 11:17:27 -03:00
|
|
|
#include <LibGfx/Point.h>
|
|
|
|
|
#include <LibGfx/Size.h>
|
2026-03-22 15:59:08 -03:00
|
|
|
#include <LibIPC/Forward.h>
|
2024-11-13 17:33:02 -03:00
|
|
|
#include <LibImageDecoderClient/Client.h>
|
2024-07-30 15:01:05 -03:00
|
|
|
#include <LibMain/Main.h>
|
2025-12-01 06:36:50 -03:00
|
|
|
#include <LibRequests/Forward.h>
|
2024-07-30 15:01:05 -03:00
|
|
|
#include <LibURL/URL.h>
|
2025-09-03 12:23:09 -03:00
|
|
|
#include <LibWeb/CSS/PreferredColorScheme.h>
|
|
|
|
|
#include <LibWeb/CSS/PreferredContrast.h>
|
|
|
|
|
#include <LibWeb/CSS/PreferredMotion.h>
|
2025-09-18 09:16:36 -03:00
|
|
|
#include <LibWeb/Clipboard/SystemClipboard.h>
|
2026-05-22 09:15:34 -03:00
|
|
|
#include <LibWeb/Compositor/Types.h>
|
2025-09-13 10:08:24 -03:00
|
|
|
#include <LibWeb/HTML/ActivateTab.h>
|
2026-03-22 12:44:54 -03:00
|
|
|
#include <LibWebView/BookmarkStore.h>
|
2026-02-03 10:00:15 -03:00
|
|
|
#include <LibWebView/FileDownloader.h>
|
2025-07-02 00:55:11 -03:00
|
|
|
#include <LibWebView/Forward.h>
|
2024-07-30 15:01:05 -03:00
|
|
|
#include <LibWebView/Options.h>
|
2024-06-30 01:24:01 -03:00
|
|
|
#include <LibWebView/Process.h>
|
|
|
|
|
#include <LibWebView/ProcessManager.h>
|
2025-03-20 13:59:44 -03:00
|
|
|
#include <LibWebView/Settings.h>
|
2025-06-08 18:35:46 -03:00
|
|
|
#include <LibWebView/StorageJar.h>
|
2024-06-30 01:24:01 -03:00
|
|
|
|
2026-03-19 15:42:05 -03:00
|
|
|
#if defined(AK_OS_MACOS)
|
|
|
|
|
# include <LibIPC/TransportBootstrapMach.h>
|
|
|
|
|
#endif
|
|
|
|
|
|
LibWebView+WebContent: Add feature-gated Compositor process backend
We are moving toward an architecture where the browser owns a single
process that holds the GPU context, so Skia resources can be shared
across every renderer and WebContent processes can be sandboxed away
from direct GPU access. A dedicated Compositor helper process is the
first step. The earlier commits laid the foundation; this one turns the
helper on as a selectable backend, gated behind
--enable-compositor-process so the existing in-process path stays the
shipping default.
Default topology -- one compositor per WebContent, in-process:
+---------+
| Browser |
+---------+
/ | \
v v v
+---+ +---+ +---+ each WebContent runs its own
|WC | |WC | |WC | CompositorThread on a dedicated
|+C+| |+C+| |+C+| thread, with its own GPU context.
+---+ +---+ +---+
Opt-in topology -- one single-threaded Compositor, shared by all WCs:
+---------+ control +-------------------+
| Browser |<----------->| Compositor |
+---------+ | (single thread, |
/ | \ | single GPU ctx, |
v v v data | shared by all |
[WC] [WC] [WC] ---------->| connected WCs) |
+-------------------+
Three IPC channels carry the work in the opt-in topology. The
existing Browser<->WebContent channel gains context allocation.
A new Browser<->Compositor channel carries context lifetime,
viewport, UI input, and presentation acks plus backing-store and
frame upcalls. A new WebContent<->Compositor channel carries
display lists, scroll state, video, compositor surfaces, async
scrolling, presentation, and screenshots, with upcalls for
delegated input and compositor loss.
2026-05-22 11:17:27 -03:00
|
|
|
namespace Web {
|
|
|
|
|
|
|
|
|
|
struct MouseEvent;
|
2026-06-14 16:30:28 -03:00
|
|
|
struct PinchEvent;
|
LibWebView+WebContent: Add feature-gated Compositor process backend
We are moving toward an architecture where the browser owns a single
process that holds the GPU context, so Skia resources can be shared
across every renderer and WebContent processes can be sandboxed away
from direct GPU access. A dedicated Compositor helper process is the
first step. The earlier commits laid the foundation; this one turns the
helper on as a selectable backend, gated behind
--enable-compositor-process so the existing in-process path stays the
shipping default.
Default topology -- one compositor per WebContent, in-process:
+---------+
| Browser |
+---------+
/ | \
v v v
+---+ +---+ +---+ each WebContent runs its own
|WC | |WC | |WC | CompositorThread on a dedicated
|+C+| |+C+| |+C+| thread, with its own GPU context.
+---+ +---+ +---+
Opt-in topology -- one single-threaded Compositor, shared by all WCs:
+---------+ control +-------------------+
| Browser |<----------->| Compositor |
+---------+ | (single thread, |
/ | \ | single GPU ctx, |
v v v data | shared by all |
[WC] [WC] [WC] ---------->| connected WCs) |
+-------------------+
Three IPC channels carry the work in the opt-in topology. The
existing Browser<->WebContent channel gains context allocation.
A new Browser<->Compositor channel carries context lifetime,
viewport, UI input, and presentation acks plus backing-store and
frame upcalls. A new WebContent<->Compositor channel carries
display lists, scroll state, video, compositor surfaces, async
scrolling, presentation, and screenshots, with upcalls for
delegated input and compositor loss.
2026-05-22 11:17:27 -03:00
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2024-06-30 01:24:01 -03:00
|
|
|
namespace WebView {
|
|
|
|
|
|
2025-04-23 13:37:05 -03:00
|
|
|
struct ApplicationSettingsObserver;
|
2026-03-22 12:44:54 -03:00
|
|
|
struct ApplicationBookmarkStoreObserver;
|
2025-04-23 13:37:05 -03:00
|
|
|
|
2025-07-02 00:55:11 -03:00
|
|
|
class WEBVIEW_API Application : public DevTools::DevToolsDelegate {
|
2024-06-30 01:24:01 -03:00
|
|
|
AK_MAKE_NONCOPYABLE(Application);
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
virtual ~Application();
|
|
|
|
|
|
2025-06-06 16:42:12 -03:00
|
|
|
ErrorOr<int> execute();
|
2024-06-30 01:24:01 -03:00
|
|
|
|
|
|
|
|
static Application& the() { return *s_the; }
|
|
|
|
|
|
2025-03-20 13:59:44 -03:00
|
|
|
static Settings& settings() { return the().m_settings; }
|
|
|
|
|
|
2025-03-15 17:56:52 -03:00
|
|
|
static BrowserOptions const& browser_options() { return the().m_browser_options; }
|
2025-10-08 22:17:05 -03:00
|
|
|
static RequestServerOptions const& request_server_options() { return the().m_request_server_options; }
|
2024-12-02 22:33:26 -03:00
|
|
|
static WebContentOptions& web_content_options() { return the().m_web_content_options; }
|
2024-07-30 15:01:05 -03:00
|
|
|
|
2024-11-13 17:33:02 -03:00
|
|
|
static Requests::RequestClient& request_server_client() { return *the().m_request_server_client; }
|
|
|
|
|
static ImageDecoderClient::Client& image_decoder_client() { return *the().m_image_decoder_client; }
|
|
|
|
|
|
2026-05-31 13:57:05 -03:00
|
|
|
virtual bool supports_vertical_tabs() const { return false; }
|
2026-05-29 10:57:15 -03:00
|
|
|
virtual bool supports_server_side_window_decorations() const { return false; }
|
2026-05-31 13:57:05 -03:00
|
|
|
void tab_settings_changed(Badge<ApplicationSettingsObserver>);
|
|
|
|
|
|
2026-03-22 12:44:54 -03:00
|
|
|
static BookmarkStore& bookmark_store() { return the().m_bookmark_store; }
|
|
|
|
|
void update_bookmark_action_for_current_web_view();
|
|
|
|
|
void bookmarks_changed(Badge<ApplicationBookmarkStoreObserver>);
|
|
|
|
|
void show_bookmarks_bar_changed(Badge<ApplicationSettingsObserver>);
|
2026-04-06 20:08:00 -03:00
|
|
|
virtual void show_bookmark_context_menu(Gfx::IntPoint, Optional<BookmarkItem const&>, [[maybe_unused]] Optional<String const&> target_folder_id) { }
|
|
|
|
|
|
2026-06-10 13:18:17 -03:00
|
|
|
static HistoryStore& history_store() { return *the().m_history_store; }
|
2024-09-05 19:19:51 -03:00
|
|
|
static CookieJar& cookie_jar() { return *the().m_cookie_jar; }
|
2026-03-26 14:04:33 -03:00
|
|
|
static HSTSStore& hsts_store() { return *the().m_hsts_store; }
|
2025-06-08 18:35:46 -03:00
|
|
|
static StorageJar& storage_jar() { return *the().m_storage_jar; }
|
2024-09-05 19:19:51 -03:00
|
|
|
|
2025-06-11 08:32:37 -03:00
|
|
|
static ProcessManager& process_manager() { return *the().m_process_manager; }
|
2026-03-19 15:42:05 -03:00
|
|
|
#if defined(AK_OS_MACOS)
|
|
|
|
|
static IPC::TransportBootstrapMachServer& transport_bootstrap_server() { return the().m_transport_bootstrap_server; }
|
2026-03-22 15:59:08 -03:00
|
|
|
void set_browser_process_transport_handler(Function<void(NonnullOwnPtr<IPC::Transport>)> handler);
|
2026-03-19 15:42:05 -03:00
|
|
|
#endif
|
2025-03-24 10:50:12 -03:00
|
|
|
|
2025-03-09 19:01:25 -03:00
|
|
|
ErrorOr<NonnullRefPtr<WebContentClient>> launch_web_content_process(ViewImplementation&);
|
2026-05-30 11:58:13 -03:00
|
|
|
u64 allocate_page_id();
|
2026-05-30 12:36:06 -03:00
|
|
|
Web::Compositor::CompositorContextId allocate_compositor_context_id();
|
2026-05-22 11:02:42 -03:00
|
|
|
ErrorOr<void> connect_web_content_to_compositor(WebContentClient&);
|
2026-05-30 12:36:06 -03:00
|
|
|
void register_compositor_context(WebContentClient&, Web::Compositor::CompositorContextId, Optional<u64> page_id);
|
|
|
|
|
ErrorOr<void> try_register_compositor_context(WebContentClient&, Web::Compositor::CompositorContextId, Optional<u64> page_id);
|
LibWebView+WebContent: Add feature-gated Compositor process backend
We are moving toward an architecture where the browser owns a single
process that holds the GPU context, so Skia resources can be shared
across every renderer and WebContent processes can be sandboxed away
from direct GPU access. A dedicated Compositor helper process is the
first step. The earlier commits laid the foundation; this one turns the
helper on as a selectable backend, gated behind
--enable-compositor-process so the existing in-process path stays the
shipping default.
Default topology -- one compositor per WebContent, in-process:
+---------+
| Browser |
+---------+
/ | \
v v v
+---+ +---+ +---+ each WebContent runs its own
|WC | |WC | |WC | CompositorThread on a dedicated
|+C+| |+C+| |+C+| thread, with its own GPU context.
+---+ +---+ +---+
Opt-in topology -- one single-threaded Compositor, shared by all WCs:
+---------+ control +-------------------+
| Browser |<----------->| Compositor |
+---------+ | (single thread, |
/ | \ | single GPU ctx, |
v v v data | shared by all |
[WC] [WC] [WC] ---------->| connected WCs) |
+-------------------+
Three IPC channels carry the work in the opt-in topology. The
existing Browser<->WebContent channel gains context allocation.
A new Browser<->Compositor channel carries context lifetime,
viewport, UI input, and presentation acks plus backing-store and
frame upcalls. A new WebContent<->Compositor channel carries
display lists, scroll state, video, compositor surfaces, async
scrolling, presentation, and screenshots, with upcalls for
delegated input and compositor loss.
2026-05-22 11:17:27 -03:00
|
|
|
void update_compositor_viewport(Web::Compositor::CompositorContextId, Gfx::IntSize viewport_size, Web::Compositor::WindowResizingInProgress = Web::Compositor::WindowResizingInProgress::No);
|
2026-05-28 14:04:22 -03:00
|
|
|
void update_compositor_display_metadata(Web::Compositor::CompositorContextId, Optional<u64> display_id, double refresh_rate);
|
LibWebView+WebContent: Add feature-gated Compositor process backend
We are moving toward an architecture where the browser owns a single
process that holds the GPU context, so Skia resources can be shared
across every renderer and WebContent processes can be sandboxed away
from direct GPU access. A dedicated Compositor helper process is the
first step. The earlier commits laid the foundation; this one turns the
helper on as a selectable backend, gated behind
--enable-compositor-process so the existing in-process path stays the
shipping default.
Default topology -- one compositor per WebContent, in-process:
+---------+
| Browser |
+---------+
/ | \
v v v
+---+ +---+ +---+ each WebContent runs its own
|WC | |WC | |WC | CompositorThread on a dedicated
|+C+| |+C+| |+C+| thread, with its own GPU context.
+---+ +---+ +---+
Opt-in topology -- one single-threaded Compositor, shared by all WCs:
+---------+ control +-------------------+
| Browser |<----------->| Compositor |
+---------+ | (single thread, |
/ | \ | single GPU ctx, |
v v v data | shared by all |
[WC] [WC] [WC] ---------->| connected WCs) |
+-------------------+
Three IPC channels carry the work in the opt-in topology. The
existing Browser<->WebContent channel gains context allocation.
A new Browser<->Compositor channel carries context lifetime,
viewport, UI input, and presentation acks plus backing-store and
frame upcalls. A new WebContent<->Compositor channel carries
display lists, scroll state, video, compositor surfaces, async
scrolling, presentation, and screenshots, with upcalls for
delegated input and compositor loss.
2026-05-22 11:17:27 -03:00
|
|
|
bool send_async_scroll_to_compositor(Web::Compositor::CompositorContextId, Gfx::FloatPoint position, Gfx::FloatPoint delta_in_device_pixels);
|
|
|
|
|
bool handle_mouse_event_in_compositor(Web::Compositor::CompositorContextId, Web::MouseEvent const&);
|
2026-06-14 16:30:28 -03:00
|
|
|
bool handle_pinch_event_in_compositor(Web::Compositor::CompositorContextId, Web::PinchEvent const&);
|
LibWeb+LibWebView+WebContent: Recover after Compositor process crashes
The browser previously treated the out-of-process Compositor as fatal.
Restart the shared Compositor from the browser process, reconnect
process-backed WebContent clients, recreate compositor contexts, restore
viewport state, and ask WebContent to repaint and republish canvas and
media resources. WebContent now marks its compositor connection lost,
returns conservative values for synchronous compositor queries while
reconnecting, and drops outgoing updates until the replacement transport
arrives.
Synchronous input queries through the compositor control connection now
use fallible IPC. If the Compositor exits after the open check or before
the sync reply arrives, scroll and mouse handling report that the
Compositor did not handle the event and let the normal WebContent
fallback run.
Mouse events queued while the Compositor is unavailable now fall back to
direct WebContent dispatch. This keeps input completion in step with the
pending-event queue.
Recovery is capped at three automatic restarts. If the restart limit is
exceeded, if restart, reconnect, or context recreation fails, or if the
replacement Compositor exits during active recovery, the browser crashes
instead of switching process-backed views to a fallback path.
2026-05-23 22:36:24 -03:00
|
|
|
bool dispatch_mouse_event_to_web_content(Web::Compositor::CompositorContextId, Web::MouseEvent const&);
|
LibWebView+WebContent: Add feature-gated Compositor process backend
We are moving toward an architecture where the browser owns a single
process that holds the GPU context, so Skia resources can be shared
across every renderer and WebContent processes can be sandboxed away
from direct GPU access. A dedicated Compositor helper process is the
first step. The earlier commits laid the foundation; this one turns the
helper on as a selectable backend, gated behind
--enable-compositor-process so the existing in-process path stays the
shipping default.
Default topology -- one compositor per WebContent, in-process:
+---------+
| Browser |
+---------+
/ | \
v v v
+---+ +---+ +---+ each WebContent runs its own
|WC | |WC | |WC | CompositorThread on a dedicated
|+C+| |+C+| |+C+| thread, with its own GPU context.
+---+ +---+ +---+
Opt-in topology -- one single-threaded Compositor, shared by all WCs:
+---------+ control +-------------------+
| Browser |<----------->| Compositor |
+---------+ | (single thread, |
/ | \ | single GPU ctx, |
v v v data | shared by all |
[WC] [WC] [WC] ---------->| connected WCs) |
+-------------------+
Three IPC channels carry the work in the opt-in topology. The
existing Browser<->WebContent channel gains context allocation.
A new Browser<->Compositor channel carries context lifetime,
viewport, UI input, and presentation acks plus backing-store and
frame upcalls. A new WebContent<->Compositor channel carries
display lists, scroll state, video, compositor surfaces, async
scrolling, presentation, and screenshots, with upcalls for
delegated input and compositor loss.
2026-05-22 11:17:27 -03:00
|
|
|
void notify_compositor_presented_bitmap_ready_to_paint(Web::Compositor::CompositorContextId, i32 bitmap_id);
|
2025-09-13 10:08:24 -03:00
|
|
|
|
2025-09-04 09:53:57 -03:00
|
|
|
virtual Optional<ViewImplementation&> active_web_view() const { return {}; }
|
2025-09-13 10:08:24 -03:00
|
|
|
virtual Optional<ViewImplementation&> open_blank_new_tab(Web::HTML::ActivateTab) const { return {}; }
|
2026-06-16 18:01:08 -03:00
|
|
|
virtual bool activate_tab_with_url(URL::URL const&) const { return false; }
|
2026-06-21 07:28:23 -03:00
|
|
|
virtual void open_url_in_new_tab(URL::URL const&, Web::HTML::ActivateTab) const;
|
2026-04-03 11:34:49 -03:00
|
|
|
void open_bookmark_in_new_tab(String const& bookmark_id, Web::HTML::ActivateTab) const;
|
2024-11-13 17:33:02 -03:00
|
|
|
|
2026-04-20 18:27:15 -03:00
|
|
|
Main::Arguments const& command_line_arguments() const { return m_arguments; }
|
2026-02-17 16:23:45 -03:00
|
|
|
virtual void open_url_in_new_window(URL::URL const& url);
|
2026-04-20 18:27:15 -03:00
|
|
|
|
2024-06-30 01:24:01 -03:00
|
|
|
void add_child_process(Process&&);
|
|
|
|
|
|
|
|
|
|
// FIXME: Should these methods be part of Application, instead of deferring to ProcessManager?
|
|
|
|
|
#if defined(AK_OS_MACH)
|
|
|
|
|
void set_process_mach_port(pid_t, Core::MachPort&&);
|
|
|
|
|
#endif
|
|
|
|
|
Optional<Process&> find_process(pid_t);
|
|
|
|
|
|
2026-01-13 07:23:09 -03:00
|
|
|
virtual bool should_capture_web_content_output() const { return false; }
|
|
|
|
|
|
2024-08-28 16:29:51 -03:00
|
|
|
ErrorOr<LexicalPath> path_for_downloaded_file(StringView file) const;
|
|
|
|
|
|
2025-09-04 09:53:57 -03:00
|
|
|
virtual void display_download_confirmation_dialog(StringView download_name, LexicalPath const& path) const;
|
|
|
|
|
virtual void display_error_dialog(StringView error_message) const;
|
|
|
|
|
|
2025-10-10 11:11:56 -03:00
|
|
|
// FIXME: We should implement UI-agnostic platform APIs to interact with the system clipboard.
|
2026-05-18 08:18:50 -03:00
|
|
|
enum class ClipboardType : u8 {
|
|
|
|
|
Text,
|
|
|
|
|
Selection,
|
|
|
|
|
};
|
2026-05-21 09:30:18 -03:00
|
|
|
virtual bool supports_clipboard_type(ClipboardType) const;
|
2026-05-18 08:18:50 -03:00
|
|
|
virtual Utf16String clipboard_text(ClipboardType = ClipboardType::Text) const;
|
2026-05-27 12:43:35 -03:00
|
|
|
virtual void set_clipboard_text(String, ClipboardType = ClipboardType::Text);
|
2026-05-21 09:30:18 -03:00
|
|
|
|
2025-10-10 11:11:56 -03:00
|
|
|
virtual Vector<Web::Clipboard::SystemClipboardRepresentation> clipboard_entries() const;
|
|
|
|
|
virtual void insert_clipboard_entry(Web::Clipboard::SystemClipboardRepresentation);
|
2025-09-18 09:16:36 -03:00
|
|
|
|
2025-11-02 20:44:17 -03:00
|
|
|
struct BrowsingDataSizes {
|
|
|
|
|
u64 cache_size_since_requested_time { 0 };
|
|
|
|
|
u64 total_cache_size { 0 };
|
|
|
|
|
|
|
|
|
|
u64 site_data_size_since_requested_time { 0 };
|
|
|
|
|
u64 total_site_data_size { 0 };
|
|
|
|
|
};
|
|
|
|
|
NonnullRefPtr<Core::Promise<BrowsingDataSizes>> estimate_browsing_data_size_accessed_since(UnixDateTime since);
|
|
|
|
|
|
|
|
|
|
struct ClearBrowsingDataOptions {
|
|
|
|
|
enum class Delete {
|
|
|
|
|
No,
|
|
|
|
|
Yes,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
UnixDateTime since { UnixDateTime::earliest() };
|
|
|
|
|
Delete delete_cached_files { Delete::No };
|
2026-04-11 20:16:07 -03:00
|
|
|
Delete delete_history { Delete::No };
|
2025-11-02 20:44:17 -03:00
|
|
|
Delete delete_site_data { Delete::No };
|
|
|
|
|
};
|
|
|
|
|
void clear_browsing_data(ClearBrowsingDataOptions const&);
|
|
|
|
|
|
2025-09-01 09:20:14 -03:00
|
|
|
Action& reload_action() { return *m_reload_action; }
|
|
|
|
|
Action& copy_selection_action() { return *m_copy_selection_action; }
|
2026-05-06 13:00:59 -03:00
|
|
|
Action& cut_selection_action() { return *m_cut_selection_action; }
|
2025-09-01 09:20:14 -03:00
|
|
|
Action& paste_action() { return *m_paste_action; }
|
|
|
|
|
Action& select_all_action() { return *m_select_all_action; }
|
2025-09-17 10:18:08 -03:00
|
|
|
|
|
|
|
|
Action& open_about_page_action() { return *m_open_about_page_action; }
|
|
|
|
|
Action& open_settings_page_action() { return *m_open_settings_page_action; }
|
2025-09-01 09:20:14 -03:00
|
|
|
|
2025-09-10 08:23:15 -03:00
|
|
|
Menu& zoom_menu() { return *m_zoom_menu; }
|
|
|
|
|
Action& reset_zoom_action() { return *m_reset_zoom_action; }
|
|
|
|
|
|
2025-09-03 12:23:09 -03:00
|
|
|
Menu& color_scheme_menu() { return *m_color_scheme_menu; }
|
|
|
|
|
Menu& contrast_menu() { return *m_contrast_menu; }
|
|
|
|
|
Menu& motion_menu() { return *m_motion_menu; }
|
2025-09-17 11:22:23 -03:00
|
|
|
|
2026-05-31 13:57:05 -03:00
|
|
|
Action& toggle_vertical_tabs_expanded_action() { return *m_toggle_vertical_tabs_expanded_action; }
|
|
|
|
|
|
2026-06-03 16:13:39 -03:00
|
|
|
Action& toggle_menu_bar_action() { return *m_toggle_menu_bar_action; }
|
|
|
|
|
|
2026-03-22 12:44:54 -03:00
|
|
|
Menu& bookmarks_menu() { return *m_bookmarks_menu; }
|
2026-03-26 17:55:05 -03:00
|
|
|
Menu& bookmarks_bar_context_menu() { return *m_bookmarks_bar_context_menu; }
|
|
|
|
|
Menu& bookmark_context_menu() { return *m_bookmark_context_menu; }
|
|
|
|
|
Menu& bookmark_folder_context_menu() { return *m_bookmark_folder_context_menu; }
|
2026-03-22 12:44:54 -03:00
|
|
|
|
2026-06-10 12:54:28 -03:00
|
|
|
Menu& history_menu() { return *m_history_menu; }
|
|
|
|
|
|
2025-09-17 11:22:23 -03:00
|
|
|
Menu& inspect_menu() { return *m_inspect_menu; }
|
|
|
|
|
Action& view_source_action() { return *m_view_source_action; }
|
|
|
|
|
|
2025-09-03 10:00:52 -03:00
|
|
|
Menu& debug_menu() { return *m_debug_menu; }
|
|
|
|
|
|
2026-02-03 10:00:15 -03:00
|
|
|
FileDownloader& file_downloader() { return m_file_downloader; }
|
|
|
|
|
|
2025-09-03 10:00:52 -03:00
|
|
|
void apply_view_options(Badge<ViewImplementation>, ViewImplementation&);
|
|
|
|
|
|
2025-09-17 11:03:01 -03:00
|
|
|
ErrorOr<void> toggle_devtools_enabled();
|
2025-02-15 10:09:47 -03:00
|
|
|
void refresh_tab_list();
|
|
|
|
|
|
2025-09-16 22:06:00 -03:00
|
|
|
Optional<Core::TimeZoneWatcher&> time_zone_watcher();
|
|
|
|
|
|
2024-06-30 01:24:01 -03:00
|
|
|
protected:
|
2025-06-10 20:20:46 -03:00
|
|
|
explicit Application(Optional<ByteString> ladybird_binary_path = {});
|
2024-07-30 15:01:05 -03:00
|
|
|
|
2025-06-10 20:20:46 -03:00
|
|
|
ErrorOr<void> initialize(Main::Arguments const&);
|
2025-06-10 20:13:03 -03:00
|
|
|
|
2026-05-12 12:20:40 -03:00
|
|
|
virtual void process_did_exit(Process&&, Optional<int> exit_status);
|
2024-06-30 01:24:01 -03:00
|
|
|
|
2024-07-30 15:01:05 -03:00
|
|
|
virtual void create_platform_arguments(Core::ArgsParser&) { }
|
2025-11-12 12:52:16 -03:00
|
|
|
virtual void create_platform_options(BrowserOptions&, RequestServerOptions&, WebContentOptions&) { }
|
2026-06-04 14:51:47 -03:00
|
|
|
virtual Core::EventLoop& create_platform_event_loop();
|
2024-07-30 15:01:05 -03:00
|
|
|
|
2026-02-02 20:54:59 -03:00
|
|
|
virtual Optional<ByteString> ask_user_for_download_path([[maybe_unused]] StringView file) const { return {}; }
|
2024-08-28 16:29:51 -03:00
|
|
|
|
2026-05-31 13:57:05 -03:00
|
|
|
virtual void update_tabs_display() const { }
|
|
|
|
|
|
2026-03-22 12:44:54 -03:00
|
|
|
virtual void rebuild_bookmarks_menu() const { }
|
2026-05-06 09:03:04 -03:00
|
|
|
virtual void on_recently_closed_entries_changed() const { }
|
2026-03-22 12:44:54 -03:00
|
|
|
|
2026-03-26 17:55:05 -03:00
|
|
|
struct BookmarkID {
|
|
|
|
|
String id;
|
|
|
|
|
Optional<String> target_folder_id;
|
|
|
|
|
};
|
|
|
|
|
virtual Optional<BookmarkID> bookmark_item_id_for_context_menu() const { return {}; }
|
|
|
|
|
|
|
|
|
|
using BookmarkPromise = Core::Promise<BookmarkItem::Bookmark>;
|
|
|
|
|
virtual NonnullRefPtr<BookmarkPromise> display_add_bookmark_dialog() const;
|
|
|
|
|
virtual NonnullRefPtr<BookmarkPromise> display_edit_bookmark_dialog([[maybe_unused]] BookmarkItem::Bookmark const& current_bookmark) const;
|
|
|
|
|
|
|
|
|
|
using BookmarkFolderPromise = Core::Promise<BookmarkItem::Folder>;
|
|
|
|
|
virtual NonnullRefPtr<BookmarkFolderPromise> display_add_bookmark_folder_dialog() const;
|
|
|
|
|
virtual NonnullRefPtr<BookmarkFolderPromise> display_edit_bookmark_folder_dialog([[maybe_unused]] BookmarkItem::Folder const& current_folder) const;
|
|
|
|
|
|
2025-09-17 11:03:01 -03:00
|
|
|
virtual void on_devtools_enabled() const;
|
|
|
|
|
virtual void on_devtools_disabled() const;
|
|
|
|
|
|
2025-06-10 15:56:24 -03:00
|
|
|
Main::Arguments& arguments() { return m_arguments; }
|
|
|
|
|
|
2024-06-30 01:24:01 -03:00
|
|
|
private:
|
2026-05-30 11:58:13 -03:00
|
|
|
ErrorOr<NonnullRefPtr<WebContentClient>> create_web_content_client(Optional<ViewImplementation&>, u64 initial_page_id);
|
2025-06-10 20:20:46 -03:00
|
|
|
ErrorOr<void> launch_services();
|
2025-03-09 19:01:25 -03:00
|
|
|
void launch_spare_web_content_process();
|
2026-05-22 11:02:42 -03:00
|
|
|
ErrorOr<void> launch_compositor_process();
|
LibWeb+LibWebView+WebContent: Recover after Compositor process crashes
The browser previously treated the out-of-process Compositor as fatal.
Restart the shared Compositor from the browser process, reconnect
process-backed WebContent clients, recreate compositor contexts, restore
viewport state, and ask WebContent to repaint and republish canvas and
media resources. WebContent now marks its compositor connection lost,
returns conservative values for synchronous compositor queries while
reconnecting, and drops outgoing updates until the replacement transport
arrives.
Synchronous input queries through the compositor control connection now
use fallible IPC. If the Compositor exits after the open check or before
the sync reply arrives, scroll and mouse handling report that the
Compositor did not handle the event and let the normal WebContent
fallback run.
Mouse events queued while the Compositor is unavailable now fall back to
direct WebContent dispatch. This keeps input completion in step with the
pending-event queue.
Recovery is capped at three automatic restarts. If the restart limit is
exceeded, if restart, reconnect, or context recreation fails, or if the
replacement Compositor exits during active recovery, the browser crashes
instead of switching process-backed views to a fallback path.
2026-05-23 22:36:24 -03:00
|
|
|
void handle_compositor_process_death();
|
|
|
|
|
void recover_compositor_process();
|
2026-05-31 15:02:05 -03:00
|
|
|
void crash_compositor_process();
|
2024-11-13 17:33:02 -03:00
|
|
|
ErrorOr<void> launch_request_server();
|
|
|
|
|
ErrorOr<void> launch_image_decoder_server();
|
2025-02-15 10:09:47 -03:00
|
|
|
ErrorOr<void> launch_devtools_server();
|
2026-05-21 12:46:17 -03:00
|
|
|
ErrorOr<void> load_content_blocker_lists();
|
2025-02-15 10:09:47 -03:00
|
|
|
|
2025-09-01 09:20:14 -03:00
|
|
|
void initialize_actions();
|
2026-05-31 13:57:05 -03:00
|
|
|
void update_vertical_tabs_action();
|
2026-03-26 17:55:05 -03:00
|
|
|
|
|
|
|
|
struct MenuData {
|
|
|
|
|
Menu& menu;
|
|
|
|
|
ReadonlySpan<BookmarkItem> items;
|
|
|
|
|
Optional<String const&> target_folder_id;
|
|
|
|
|
};
|
|
|
|
|
void create_bookmark_menu_items(Optional<MenuData> = {});
|
2026-03-22 12:44:54 -03:00
|
|
|
|
2025-02-15 10:09:47 -03:00
|
|
|
virtual Vector<DevTools::TabDescription> tab_list() const override;
|
|
|
|
|
virtual Vector<DevTools::CSSProperty> css_property_list() const override;
|
2026-05-29 11:09:35 -03:00
|
|
|
virtual void navigate_tab(DevTools::TabDescription const&, String const&) const override;
|
2026-05-28 13:30:10 -03:00
|
|
|
virtual void reload_tab(DevTools::TabDescription const&, bool) const override;
|
2026-05-28 13:48:38 -03:00
|
|
|
virtual void traverse_the_history_by_delta(DevTools::TabDescription const&, int) const override;
|
2026-06-10 07:14:42 -03:00
|
|
|
virtual Vector<HTTP::Cookie::Cookie> cookies(DevTools::TabDescription const&) const override;
|
2026-06-10 07:46:13 -03:00
|
|
|
virtual ErrorOr<void> set_cookie(DevTools::TabDescription const&, Optional<HTTP::Cookie::Cookie>, HTTP::Cookie::Cookie) const override;
|
|
|
|
|
virtual void delete_cookies(DevTools::TabDescription const&, Vector<HTTP::Cookie::Cookie>) const override;
|
2026-06-10 07:19:44 -03:00
|
|
|
virtual void listen_for_host_cookie_changes(DevTools::TabDescription const&, OnHostCookieChange) const override;
|
|
|
|
|
virtual void stop_listening_for_host_cookie_changes(DevTools::TabDescription const&) const override;
|
2026-06-10 12:15:21 -03:00
|
|
|
virtual void inspect_storage(DevTools::TabDescription const&, Web::StorageAPI::StorageEndpointType, OnStorageItemsReceived) const override;
|
2026-06-10 12:27:25 -03:00
|
|
|
virtual ErrorOr<Optional<String>> set_storage_item(DevTools::TabDescription const&, Web::StorageAPI::StorageEndpointType, String const&, String const&, String const&) const override;
|
|
|
|
|
virtual ErrorOr<Optional<String>> remove_storage_item(DevTools::TabDescription const&, Web::StorageAPI::StorageEndpointType, String const&, String const&) const override;
|
|
|
|
|
virtual ErrorOr<void> clear_storage(DevTools::TabDescription const&, Web::StorageAPI::StorageEndpointType, String const&) const override;
|
2026-06-11 10:12:37 -03:00
|
|
|
virtual u64 add_storage_change_listener(DevTools::TabDescription const&, OnStorageChange) const override;
|
|
|
|
|
virtual void remove_storage_change_listener(DevTools::TabDescription const&, u64) const override;
|
2026-06-17 08:39:37 -03:00
|
|
|
virtual void inspect_indexed_database_storage(DevTools::TabDescription const&, OnIndexedDBInspectionComplete) const override;
|
|
|
|
|
virtual void inspect_indexed_database_objects(DevTools::TabDescription const&, String const&, Optional<JsonArray>, JsonObject, OnIndexedDBInspectionComplete) const override;
|
2026-06-11 12:51:05 -03:00
|
|
|
virtual void delete_indexed_database(DevTools::TabDescription const&, String const&, String const&, OnIndexedDBInspectionComplete) const override;
|
|
|
|
|
virtual void clear_indexed_database_object_store(DevTools::TabDescription const&, String const&, String const&, OnIndexedDBInspectionComplete) const override;
|
|
|
|
|
virtual void delete_indexed_database_record(DevTools::TabDescription const&, String const&, String const&, OnIndexedDBInspectionComplete) const override;
|
|
|
|
|
virtual u64 add_indexed_database_change_listener(DevTools::TabDescription const&, OnIndexedDatabaseChange) const override;
|
|
|
|
|
virtual void remove_indexed_database_change_listener(DevTools::TabDescription const&, u64) const override;
|
2025-02-21 18:22:12 -03:00
|
|
|
virtual void inspect_tab(DevTools::TabDescription const&, OnTabInspectionComplete) const override;
|
2025-10-13 07:37:36 -03:00
|
|
|
virtual void inspect_accessibility_tree(DevTools::TabDescription const&, OnAccessibilityTreeInspectionComplete) const override;
|
2025-03-19 16:50:56 -03:00
|
|
|
virtual void listen_for_dom_properties(DevTools::TabDescription const&, OnDOMNodePropertiesReceived) const override;
|
|
|
|
|
virtual void stop_listening_for_dom_properties(DevTools::TabDescription const&) const override;
|
2026-06-04 11:17:17 -03:00
|
|
|
virtual void inspect_dom_node(DevTools::TabDescription const&, DOMNodeProperties::Type, Web::UniqueNodeID, Optional<Web::CSS::PseudoElement>, JsonObject options = {}) const override;
|
2025-02-21 18:22:12 -03:00
|
|
|
virtual void clear_inspected_dom_node(DevTools::TabDescription const&) const override;
|
2026-05-28 08:14:41 -03:00
|
|
|
virtual void start_node_picker(DevTools::TabDescription const&, OnNodePickerEvent) const override;
|
|
|
|
|
virtual void stop_node_picker(DevTools::TabDescription const&) const override;
|
|
|
|
|
virtual void clear_node_picker(DevTools::TabDescription const&) const override;
|
2026-05-22 10:42:29 -03:00
|
|
|
virtual void inspect_grid_layouts(DevTools::TabDescription const&, Web::UniqueNodeID, OnGridLayoutsReceived) const override;
|
|
|
|
|
virtual void inspect_current_grid(DevTools::TabDescription const&, Web::UniqueNodeID, OnCurrentGridReceived) const override;
|
2026-05-27 12:41:13 -03:00
|
|
|
virtual void inspect_current_flexbox(DevTools::TabDescription const&, Web::UniqueNodeID, bool, OnCurrentFlexboxReceived) const override;
|
2025-03-20 13:56:46 -03:00
|
|
|
virtual void highlight_dom_node(DevTools::TabDescription const&, Web::UniqueNodeID, Optional<Web::CSS::PseudoElement>) const override;
|
2025-02-21 18:22:12 -03:00
|
|
|
virtual void clear_highlighted_dom_node(DevTools::TabDescription const&) const override;
|
2026-05-27 13:12:14 -03:00
|
|
|
virtual void highlight_flexbox(DevTools::TabDescription const&, Web::UniqueNodeID, JsonValue) const override;
|
|
|
|
|
virtual void clear_flexbox_highlight(DevTools::TabDescription const&, Web::UniqueNodeID) const override;
|
2026-05-22 10:42:29 -03:00
|
|
|
virtual void highlight_grid(DevTools::TabDescription const&, Web::UniqueNodeID, JsonValue) const override;
|
|
|
|
|
virtual void clear_grid_highlight(DevTools::TabDescription const&, Web::UniqueNodeID) const override;
|
2025-03-06 21:56:03 -03:00
|
|
|
virtual void listen_for_dom_mutations(DevTools::TabDescription const&, OnDOMMutationReceived) const override;
|
|
|
|
|
virtual void stop_listening_for_dom_mutations(DevTools::TabDescription const&) const override;
|
2025-03-10 19:15:31 -03:00
|
|
|
virtual void get_dom_node_inner_html(DevTools::TabDescription const&, Web::UniqueNodeID, OnDOMNodeHTMLReceived) const override;
|
2025-03-10 18:36:41 -03:00
|
|
|
virtual void get_dom_node_outer_html(DevTools::TabDescription const&, Web::UniqueNodeID, OnDOMNodeHTMLReceived) const override;
|
|
|
|
|
virtual void set_dom_node_outer_html(DevTools::TabDescription const&, Web::UniqueNodeID, String const&, OnDOMNodeEditComplete) const override;
|
2025-03-08 13:00:03 -03:00
|
|
|
virtual void set_dom_node_text(DevTools::TabDescription const&, Web::UniqueNodeID, String const&, OnDOMNodeEditComplete) const override;
|
|
|
|
|
virtual void set_dom_node_tag(DevTools::TabDescription const&, Web::UniqueNodeID, String const&, OnDOMNodeEditComplete) const override;
|
|
|
|
|
virtual void add_dom_node_attributes(DevTools::TabDescription const&, Web::UniqueNodeID, ReadonlySpan<Attribute>, OnDOMNodeEditComplete) const override;
|
|
|
|
|
virtual void replace_dom_node_attribute(DevTools::TabDescription const&, Web::UniqueNodeID, String const&, ReadonlySpan<Attribute>, OnDOMNodeEditComplete) const override;
|
2025-03-07 11:19:28 -03:00
|
|
|
virtual void create_child_element(DevTools::TabDescription const&, Web::UniqueNodeID, OnDOMNodeEditComplete) const override;
|
2025-03-10 19:01:29 -03:00
|
|
|
virtual void insert_dom_node_before(DevTools::TabDescription const&, Web::UniqueNodeID, Web::UniqueNodeID, Optional<Web::UniqueNodeID>, OnDOMNodeEditComplete) const override;
|
2025-03-07 11:44:24 -03:00
|
|
|
virtual void clone_dom_node(DevTools::TabDescription const&, Web::UniqueNodeID, OnDOMNodeEditComplete) const override;
|
2025-03-06 22:08:27 -03:00
|
|
|
virtual void remove_dom_node(DevTools::TabDescription const&, Web::UniqueNodeID, OnDOMNodeEditComplete) const override;
|
2025-03-11 18:14:54 -03:00
|
|
|
virtual void retrieve_style_sheets(DevTools::TabDescription const&, OnStyleSheetsReceived) const override;
|
|
|
|
|
virtual void retrieve_style_sheet_source(DevTools::TabDescription const&, Web::CSS::StyleSheetIdentifier const&) const override;
|
|
|
|
|
virtual void listen_for_style_sheet_sources(DevTools::TabDescription const&, OnStyleSheetSourceReceived) const override;
|
|
|
|
|
virtual void stop_listening_for_style_sheet_sources(DevTools::TabDescription const&) const override;
|
2025-03-08 13:00:03 -03:00
|
|
|
virtual void evaluate_javascript(DevTools::TabDescription const&, String const&, OnScriptEvaluationComplete) const override;
|
2026-01-14 16:13:24 -03:00
|
|
|
virtual void listen_for_console_messages(DevTools::TabDescription const&, OnConsoleMessage) const override;
|
2025-03-04 10:48:20 -03:00
|
|
|
virtual void stop_listening_for_console_messages(DevTools::TabDescription const&) const override;
|
2026-01-14 16:47:04 -03:00
|
|
|
virtual void listen_for_network_events(DevTools::TabDescription const&, OnNetworkRequestStarted, OnNetworkResponseHeadersReceived, OnNetworkResponseBodyReceived, OnNetworkRequestFinished) const override;
|
2026-01-14 14:43:48 -03:00
|
|
|
virtual void stop_listening_for_network_events(DevTools::TabDescription const&) const override;
|
2026-01-14 15:03:16 -03:00
|
|
|
virtual void listen_for_navigation_events(DevTools::TabDescription const&, OnNavigationStarted, OnNavigationFinished) const override;
|
|
|
|
|
virtual void stop_listening_for_navigation_events(DevTools::TabDescription const&) const override;
|
2026-01-15 10:28:42 -03:00
|
|
|
virtual void did_connect_devtools_client(DevTools::TabDescription const&) const override;
|
|
|
|
|
virtual void did_disconnect_devtools_client(DevTools::TabDescription const&) const override;
|
2024-11-13 17:33:02 -03:00
|
|
|
|
2024-06-30 01:24:01 -03:00
|
|
|
static Application* s_the;
|
|
|
|
|
|
2025-03-20 13:59:44 -03:00
|
|
|
Settings m_settings;
|
2025-04-23 13:37:05 -03:00
|
|
|
OwnPtr<ApplicationSettingsObserver> m_settings_observer;
|
2025-03-20 13:59:44 -03:00
|
|
|
|
2026-03-22 12:44:54 -03:00
|
|
|
BookmarkStore m_bookmark_store;
|
|
|
|
|
OwnPtr<ApplicationBookmarkStoreObserver> m_bookmark_store_observer;
|
2026-04-11 19:32:29 -03:00
|
|
|
OwnPtr<HistoryStore> m_history_store;
|
2026-03-22 12:44:54 -03:00
|
|
|
|
2025-06-10 15:56:24 -03:00
|
|
|
Main::Arguments m_arguments;
|
2025-03-15 17:56:52 -03:00
|
|
|
BrowserOptions m_browser_options;
|
2025-10-08 22:17:05 -03:00
|
|
|
RequestServerOptions m_request_server_options;
|
2024-07-30 15:01:05 -03:00
|
|
|
WebContentOptions m_web_content_options;
|
2026-05-21 12:46:17 -03:00
|
|
|
Optional<Core::AnonymousBuffer> m_content_blocker_list_buffer;
|
2024-07-30 15:01:05 -03:00
|
|
|
|
2024-11-13 17:33:02 -03:00
|
|
|
RefPtr<Requests::RequestClient> m_request_server_client;
|
|
|
|
|
RefPtr<ImageDecoderClient::Client> m_image_decoder_client;
|
2026-05-22 11:02:42 -03:00
|
|
|
RefPtr<CompositorClient> m_compositor_client;
|
LibWeb+LibWebView+WebContent: Recover after Compositor process crashes
The browser previously treated the out-of-process Compositor as fatal.
Restart the shared Compositor from the browser process, reconnect
process-backed WebContent clients, recreate compositor contexts, restore
viewport state, and ask WebContent to repaint and republish canvas and
media resources. WebContent now marks its compositor connection lost,
returns conservative values for synchronous compositor queries while
reconnecting, and drops outgoing updates until the replacement transport
arrives.
Synchronous input queries through the compositor control connection now
use fallible IPC. If the Compositor exits after the open check or before
the sync reply arrives, scroll and mouse handling report that the
Compositor did not handle the event and let the normal WebContent
fallback run.
Mouse events queued while the Compositor is unavailable now fall back to
direct WebContent dispatch. This keeps input completion in step with the
pending-event queue.
Recovery is capped at three automatic restarts. If the restart limit is
exceeded, if restart, reconnect, or context recreation fails, or if the
replacement Compositor exits during active recovery, the browser crashes
instead of switching process-backed views to a fallback path.
2026-05-23 22:36:24 -03:00
|
|
|
size_t m_compositor_restart_count { 0 };
|
|
|
|
|
enum class CompositorRecoveryState {
|
|
|
|
|
Idle,
|
|
|
|
|
Queued,
|
|
|
|
|
Recovering,
|
|
|
|
|
};
|
|
|
|
|
CompositorRecoveryState m_compositor_recovery_state { CompositorRecoveryState::Idle };
|
2024-11-13 17:33:02 -03:00
|
|
|
|
2025-03-09 19:01:25 -03:00
|
|
|
RefPtr<WebContentClient> m_spare_web_content_process;
|
|
|
|
|
bool m_has_queued_task_to_launch_spare_web_content_process { false };
|
2026-05-30 12:36:06 -03:00
|
|
|
u64 m_next_page_or_compositor_context_id { 1 };
|
2025-03-09 19:01:25 -03:00
|
|
|
|
2025-10-07 15:35:22 -03:00
|
|
|
RefPtr<Database::Database> m_database;
|
2026-04-11 19:32:29 -03:00
|
|
|
RefPtr<Database::Database> m_history_database;
|
2024-09-05 19:19:51 -03:00
|
|
|
OwnPtr<CookieJar> m_cookie_jar;
|
2026-03-26 14:04:33 -03:00
|
|
|
OwnPtr<HSTSStore> m_hsts_store;
|
2025-06-08 18:35:46 -03:00
|
|
|
OwnPtr<StorageJar> m_storage_jar;
|
2024-09-05 19:19:51 -03:00
|
|
|
|
2024-08-24 13:15:20 -03:00
|
|
|
OwnPtr<Core::TimeZoneWatcher> m_time_zone_watcher;
|
|
|
|
|
|
2026-06-04 14:51:47 -03:00
|
|
|
Core::EventLoop* m_event_loop { nullptr };
|
2025-06-11 08:32:37 -03:00
|
|
|
OwnPtr<ProcessManager> m_process_manager;
|
2025-02-15 10:09:47 -03:00
|
|
|
|
2025-09-01 09:20:14 -03:00
|
|
|
RefPtr<Action> m_reload_action;
|
|
|
|
|
RefPtr<Action> m_copy_selection_action;
|
2026-05-06 13:00:59 -03:00
|
|
|
RefPtr<Action> m_cut_selection_action;
|
2025-09-01 09:20:14 -03:00
|
|
|
RefPtr<Action> m_paste_action;
|
|
|
|
|
RefPtr<Action> m_select_all_action;
|
2025-09-17 10:18:08 -03:00
|
|
|
|
|
|
|
|
RefPtr<Action> m_open_about_page_action;
|
|
|
|
|
RefPtr<Action> m_open_settings_page_action;
|
2025-09-01 09:20:14 -03:00
|
|
|
|
2025-09-10 08:23:15 -03:00
|
|
|
RefPtr<Menu> m_zoom_menu;
|
|
|
|
|
RefPtr<Action> m_reset_zoom_action;
|
|
|
|
|
|
2025-09-03 12:23:09 -03:00
|
|
|
RefPtr<Menu> m_color_scheme_menu;
|
|
|
|
|
Web::CSS::PreferredColorScheme m_color_scheme { Web::CSS::PreferredColorScheme::Auto };
|
|
|
|
|
|
|
|
|
|
RefPtr<Menu> m_contrast_menu;
|
|
|
|
|
Web::CSS::PreferredContrast m_contrast { Web::CSS::PreferredContrast::Auto };
|
|
|
|
|
|
|
|
|
|
RefPtr<Menu> m_motion_menu;
|
|
|
|
|
Web::CSS::PreferredMotion m_motion { Web::CSS::PreferredMotion::Auto };
|
|
|
|
|
|
2026-05-31 13:57:05 -03:00
|
|
|
RefPtr<Action> m_toggle_vertical_tabs_expanded_action;
|
|
|
|
|
|
2026-06-03 16:13:39 -03:00
|
|
|
RefPtr<Action> m_toggle_menu_bar_action;
|
|
|
|
|
|
2026-03-22 12:44:54 -03:00
|
|
|
RefPtr<Menu> m_bookmarks_menu;
|
|
|
|
|
RefPtr<Action> m_toggle_bookmark_action;
|
|
|
|
|
RefPtr<Action> m_toggle_bookmark_bar_action;
|
|
|
|
|
size_t m_bookmarks_menu_static_size { 0 };
|
|
|
|
|
|
2026-03-26 17:55:05 -03:00
|
|
|
RefPtr<Menu> m_bookmarks_bar_context_menu;
|
|
|
|
|
RefPtr<Menu> m_bookmark_context_menu;
|
|
|
|
|
RefPtr<Menu> m_bookmark_folder_context_menu;
|
|
|
|
|
|
2026-06-10 12:54:28 -03:00
|
|
|
RefPtr<Menu> m_history_menu;
|
|
|
|
|
|
2025-09-17 11:22:23 -03:00
|
|
|
RefPtr<Menu> m_inspect_menu;
|
|
|
|
|
RefPtr<Action> m_view_source_action;
|
|
|
|
|
RefPtr<Action> m_toggle_devtools_action;
|
|
|
|
|
|
2025-09-03 10:00:52 -03:00
|
|
|
RefPtr<Menu> m_debug_menu;
|
|
|
|
|
RefPtr<Action> m_show_line_box_borders_action;
|
2026-05-30 05:04:28 -03:00
|
|
|
RefPtr<Action> m_show_caret_hit_test_debug_overlay_action;
|
2025-09-03 10:00:52 -03:00
|
|
|
RefPtr<Action> m_enable_scripting_action;
|
2026-05-21 11:36:25 -03:00
|
|
|
RefPtr<Action> m_enable_content_blocking_action;
|
2025-09-03 10:00:52 -03:00
|
|
|
RefPtr<Action> m_block_pop_ups_action;
|
|
|
|
|
StringView m_user_agent_string;
|
|
|
|
|
StringView m_navigator_compatibility_mode;
|
|
|
|
|
|
2025-10-10 11:11:56 -03:00
|
|
|
Optional<Web::Clipboard::SystemClipboardRepresentation> m_clipboard;
|
|
|
|
|
|
2026-02-03 10:00:15 -03:00
|
|
|
FileDownloader m_file_downloader;
|
|
|
|
|
|
2025-06-10 20:20:46 -03:00
|
|
|
#if defined(AK_OS_MACOS)
|
2026-03-24 03:28:28 -03:00
|
|
|
OwnPtr<IPC::MachBootstrapListener> m_mach_port_server;
|
2026-03-19 15:42:05 -03:00
|
|
|
IPC::TransportBootstrapMachServer m_transport_bootstrap_server;
|
2026-03-22 15:59:08 -03:00
|
|
|
Function<void(NonnullOwnPtr<IPC::Transport>)> m_on_browser_process_transport;
|
2025-06-10 20:20:46 -03:00
|
|
|
#endif
|
|
|
|
|
|
2025-02-15 10:09:47 -03:00
|
|
|
OwnPtr<DevTools::DevToolsServer> m_devtools;
|
2026-01-14 15:03:16 -03:00
|
|
|
|
|
|
|
|
mutable HashMap<u64, u64> m_navigation_listener_ids;
|
2026-02-17 10:23:39 -03:00
|
|
|
};
|
2025-04-23 13:37:05 -03:00
|
|
|
|
2024-06-30 01:24:01 -03:00
|
|
|
}
|
2024-07-30 15:01:05 -03:00
|
|
|
|
2025-06-10 20:20:46 -03:00
|
|
|
#define WEB_VIEW_APPLICATION(ApplicationType) \
|
|
|
|
|
public: \
|
|
|
|
|
template<typename... ApplicationArguments> \
|
|
|
|
|
static ErrorOr<NonnullOwnPtr<ApplicationType>> create(Main::Arguments const& arguments, ApplicationArguments&&... application_arguments) \
|
|
|
|
|
{ \
|
|
|
|
|
auto app = adopt_own(*new ApplicationType { forward<ApplicationArguments>(application_arguments)... }); \
|
|
|
|
|
TRY(app->initialize(arguments)); \
|
|
|
|
|
return app; \
|
|
|
|
|
} \
|
|
|
|
|
\
|
|
|
|
|
static ApplicationType& the() \
|
|
|
|
|
{ \
|
|
|
|
|
return static_cast<ApplicationType&>(WebView::Application::the()); \
|
|
|
|
|
} \
|
|
|
|
|
\
|
2025-06-10 20:15:40 -03:00
|
|
|
private:
|