diff options
author | MacDue <macdue@dueutil.tech> | 2023-04-15 01:04:28 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2023-04-15 06:37:51 +0200 |
commit | 0329ddf46a0d24303fac5954bf3c70d5f3fe577c (patch) | |
tree | 83ca60d767bfde06438e191fe4b0a4c7b0da10aa /Userland/Libraries/LibWebView/ViewImplementation.h | |
parent | 5db1eb996173b34960f48c7ea8ce4fd33acde157 (diff) | |
download | serenity-0329ddf46a0d24303fac5954bf3c70d5f3fe577c.zip |
Ladybird+LibWebView: Add -P/--enable-callgrind-profiling option
This adds a -P option to run Ladybird under callgrind. It starts with
instrumentation disabled. To start capturing a profile (once Ladybird
has launched) run `callgrind_control -i on` and to stop it again run
`callgrind_control -i off`.
P.s. This is pretty much stolen from Andreas (and is based on the patch
everyone [that wants a profile] have been manually applying).
Diffstat (limited to 'Userland/Libraries/LibWebView/ViewImplementation.h')
-rw-r--r-- | Userland/Libraries/LibWebView/ViewImplementation.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Userland/Libraries/LibWebView/ViewImplementation.h b/Userland/Libraries/LibWebView/ViewImplementation.h index 0aa276da80..a7342a3cb8 100644 --- a/Userland/Libraries/LibWebView/ViewImplementation.h +++ b/Userland/Libraries/LibWebView/ViewImplementation.h @@ -18,6 +18,12 @@ namespace WebView { +// Note: This only exists inside Serenity to avoid #ifdefs in all implementors of ViewImplementation. +enum class EnableCallgrindProfiling { + No, + Yes +}; + class ViewImplementation { public: virtual ~ViewImplementation() { } @@ -120,11 +126,12 @@ protected: WebContentClient& client(); WebContentClient const& client() const; - virtual void create_client() = 0; virtual void update_zoom() = 0; + virtual void create_client(EnableCallgrindProfiling = EnableCallgrindProfiling::No) {}; + #if !defined(AK_OS_SERENITY) - ErrorOr<NonnullRefPtr<WebView::WebContentClient>> launch_web_content_process(ReadonlySpan<String> candidate_web_content_paths); + ErrorOr<NonnullRefPtr<WebView::WebContentClient>> launch_web_content_process(ReadonlySpan<String> candidate_web_content_paths, EnableCallgrindProfiling = EnableCallgrindProfiling::No); #endif struct SharedBitmap { |