Bug 228227

Summary: [GTK][WPE] Add API to pass WebKitMemoryPressureHandler parameters to the network processes
Product: WebKit Reporter: Miguel Gomez <magomez>
Component: WebKitGTKAssignee: Miguel Gomez <magomez>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, berto, bugs-noreply, cdumez, cgarcia, cmarcelo, ews-watchlist, gustavo
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Description Miguel Gomez 2021-07-23 02:52:19 PDT
Now that WebKitMemoryPressureSettings have been added to WebKitGTK and WPE in bug 222738, we need a way to pass these settings to the network processes as well.
Comment 1 Miguel Gomez 2021-07-23 05:09:10 PDT
Created attachment 434081 [details]
Patch
Comment 2 EWS Watchlist 2021-07-23 05:10:19 PDT
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See https://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Comment 3 Carlos Garcia Campos 2021-08-13 01:42:34 PDT
Comment on attachment 434081 [details]
Patch

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

> Source/WebKit/UIProcess/soup/WebProcessPoolSoup.cpp:42
> +    static const char* disableMemoryPressureMonitor = getenv("WEBKIT_DISABLE_MEMORY_PRESSURE_MONITOR");

Since this is static, you should check if we already have a value before getting it again.

> Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebsiteData.cpp:823
> +        WebKitMemoryPressureSettings* settings = webkit_memory_pressure_settings_new();
> +        webkit_website_data_manager_set_memory_pressure_settings(settings);
> +        webkit_memory_pressure_settings_free(settings);

Since the config is std::optional, I think we can allow to pass NULL and pass std::optional to the process pool
Comment 4 Miguel Gomez 2021-08-13 07:59:18 PDT
Created attachment 435483 [details]
Patch
Comment 5 EWS 2021-08-15 23:56:08 PDT
Committed r281070 (240531@main): <https://commits.webkit.org/240531@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 435483 [details].