Bug 236971 - [GTK][WPE] Suspend web process after some time in the process cache
Summary: [GTK][WPE] Suspend web process after some time in the process cache
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
Keywords: Gtk
Depends on:
Reported: 2022-02-21 06:01 PST by Carlos Garcia Campos
Modified: 2022-02-22 00:47 PST (History)
2 users (show)

See Also:

Patch (5.65 KB, patch)
2022-02-21 06:03 PST, Carlos Garcia Campos
mcatanzaro: review+
ews-feeder: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Garcia Campos 2022-02-21 06:01:40 PST
And resume them when they are restored
Comment 1 Carlos Garcia Campos 2022-02-21 06:03:19 PST
Created attachment 452728 [details]
Comment 2 Michael Catanzaro 2022-02-21 07:40:48 PST
Comment on attachment 452728 [details]

What could go wrong? :)
Comment 3 Michael Catanzaro 2022-02-21 07:43:26 PST
Comment on attachment 452728 [details]

View in context: https://bugs.webkit.org/attachment.cgi?id=452728&action=review

> Source/WebKit/UIProcess/glib/WebProcessProxyGLib.cpp:81
> +void WebProcessProxy::platformSuspendProcess()
> +{
> +    auto id = processIdentifier();
> +    if (!id)
> +        return;
> +
> +    RELEASE_LOG(Process, "%p - [PID=%i] WebProcessProxy::platformSuspendProcess", this, id);
> +    kill(id, SIGSTOP);
> +}

Since there is nothing GTK/WPE-specific here, I think I would move this to a WebProcessProxyUnix.cpp and guard it with #if !PLATFORM(COCOA). Then instead of #if PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(WPE) guards, you would only need to use #if PLATFORM(MAC) || OS(UNIX) guards instead.

Um, is OS(UNIX) true for PLATFORM(IOS_FAMILY)? I'm not sure. Got to be careful about that, if so.
Comment 4 Carlos Garcia Campos 2022-02-22 00:47:50 PST
Committed r290291 (247615@trunk): <https://commits.webkit.org/247615@trunk>