From d94e83943fee65b0be50225af89eae9295ba100c Mon Sep 17 00:00:00 2001 From: Filipe Norte Date: Wed, 22 May 2024 16:44:05 +0000 Subject: [PATCH] RDK-48800: Add pressure settings for service worker process --- WebKitBrowser/CMakeLists.txt | 20 ++++++++++++++ WebKitBrowser/HtmlApp.conf.in | 8 ++++++ WebKitBrowser/JSPP.conf.in | 9 +++++++ WebKitBrowser/LightningApp.conf.in | 9 +++++++ WebKitBrowser/ResidentApp.conf.in | 9 +++++++ WebKitBrowser/SearchAndDiscoveryApp.conf.in | 9 +++++++ WebKitBrowser/WebKitBrowser.conf.in | 9 +++++++ WebKitBrowser/WebKitImplementation.cpp | 29 +++++++++++++++++++-- 8 files changed, 100 insertions(+), 2 deletions(-) diff --git a/WebKitBrowser/CMakeLists.txt b/WebKitBrowser/CMakeLists.txt index e6ff8f7a36..ab4f560ba8 100644 --- a/WebKitBrowser/CMakeLists.txt +++ b/WebKitBrowser/CMakeLists.txt @@ -68,6 +68,8 @@ set(PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_WEBPROCESS_SETTINGS_GPU_FILE "" CACHE ST set(PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_WEBPROCESS_SETTINGS_POLLINTERVAL "1" CACHE STRING "WebkitBrower Memory Pressure Webprocess Poll Interval") set(PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_LIMIT "100" CACHE STRING "WebkitBrower Memory Pressure Networkprocess Limit") set(PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_POLLINTERVAL "1" CACHE STRING "WebkitBrower Memory Pressure Networkprocess Poll Interval") +set(PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_LIMIT "100" CACHE STRING "WebkitBrower Memory Pressure Service Worker process Limit") +set(PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_POLLINTERVAL "1" CACHE STRING "WebkitBrower Memory Pressure Service Worker process Poll Interval") set(PLUGIN_WEBKITBROWSER_MEDIA_CONTENT_TYPES_REQUIRING_HARDWARE_SUPPORT "video/*" CACHE STRING "Media content types requiring hardware support") set(PLUGIN_WEBKITBROWSER_MEDIADISKCACHE "false" CACHE STRING "Media Disk Cache") set(PLUGIN_WEBKITBROWSER_MSEBUFFERS "audio:2m,video:15m,text:1m" CACHE STRING "MSE Buffers for WebKit") @@ -104,6 +106,8 @@ set(PLUGIN_YOUTUBE_MEMORYPRESSURE_WEBPROCESS_SETTINGS_GPU_FILE ${PLUGIN_WEBKITBR set(PLUGIN_YOUTUBE_MEMORYPRESSURE_WEBPROCESS_SETTINGS_POLLINTERVAL ${PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_WEBPROCESS_SETTINGS_POLLINTERVAL} CACHE STRING "YouTube Memory Pressure Webprocess Poll Interval") set(PLUGIN_YOUTUBE_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_LIMIT ${PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_LIMIT} CACHE STRING "YouTube Memory Pressure Networkprocess Limit") set(PLUGIN_YOUTUBE_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_POLLINTERVAL ${PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_POLLINTERVAL} CACHE STRING "YouTube Memory Pressure Networkprocess Poll Interval") +set(PLUGIN_YOUTUBE_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_LIMIT ${PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_LIMIT} CACHE STRING "YouTube Memory Pressure Service Worker kprocess Limit") +set(PLUGIN_YOUTUBE_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_POLLINTERVAL ${PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_POLLINTERVAL} CACHE STRING "YouTube Memory Pressure Service Worker process Poll Interval") set(PLUGIN_UX_AUTOSTART "false" CACHE STRING "Automatically start UX plugin") set(PLUGIN_UX_STARTUPORDER "" CACHE STRING "To configure startup order of UX plugin") @@ -118,6 +122,8 @@ set(PLUGIN_UX_MEMORYPRESSURE_WEBPROCESS_SETTINGS_GPU_FILE ${PLUGIN_WEBKITBROWSER set(PLUGIN_UX_MEMORYPRESSURE_WEBPROCESS_SETTINGS_POLLINTERVAL ${PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_WEBPROCESS_SETTINGS_POLLINTERVAL} CACHE STRING "UX Memory Pressure Webprocess Poll Interval") set(PLUGIN_UX_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_LIMIT ${PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_LIMIT} CACHE STRING "UX Memory Pressure Networkprocess Limit") set(PLUGIN_UX_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_POLLINTERVAL ${PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_POLLINTERVAL} CACHE STRING "UX Memory Pressure Networkprocess Poll Interval") +set(PLUGIN_UX_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_LIMIT ${PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_LIMIT} CACHE STRING "UX Memory Pressure Service Worker kprocess Limit") +set(PLUGIN_UX_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_POLLINTERVAL ${PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_POLLINTERVAL} CACHE STRING "UX Memory Pressure Service Worker process Poll Interval") set(PLUGIN_APPS_AUTOSTART "false" CACHE STRING "Automatically start Apps plugin") set(PLUGIN_APPS_STARTUPORDER "" CACHE STRING "To configure startup order of Apps plugin") @@ -133,6 +139,8 @@ set(PLUGIN_APPS_MEMORYPRESSURE_WEBPROCESS_SETTINGS_GPU_FILE ${PLUGIN_WEBKITBROWS set(PLUGIN_APPS_MEMORYPRESSURE_WEBPROCESS_SETTINGS_POLLINTERVAL ${PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_WEBPROCESS_SETTINGS_POLLINTERVAL} CACHE STRING "Apps Memory Pressure Webprocess Poll Interval") set(PLUGIN_APPS_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_LIMIT ${PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_LIMIT} CACHE STRING "Apps Memory Pressure Networkprocess Limit") set(PLUGIN_APPS_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_POLLINTERVAL ${PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_POLLINTERVAL} CACHE STRING "Apps Memory Pressure Networkprocess Poll Interval") +set(PLUGIN_APPS_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_LIMIT ${PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_LIMIT} CACHE STRING "Apps Memory Pressure Service Worker kprocess Limit") +set(PLUGIN_APPS_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_POLLINTERVAL ${PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_POLLINTERVAL} CACHE STRING "Apps Memory Pressure Service Worker process Poll Interval") set(PLUGIN_RESIDENT_APP_AUTOSTART "false" CACHE STRING "Automatically start Resident App plugin") set(PLUGIN_RESIDENT_APP_STARTUPORDER "" CACHE STRING "To configure startup order of Resident App plugin") @@ -148,6 +156,8 @@ set(PLUGIN_RESIDENT_APP_MEMORYPRESSURE_WEBPROCESS_SETTINGS_GPU_FILE ${PLUGIN_WEB set(PLUGIN_RESIDENT_APP_MEMORYPRESSURE_WEBPROCESS_SETTINGS_POLLINTERVAL ${PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_WEBPROCESS_SETTINGS_POLLINTERVAL} CACHE STRING "Resident App Memory Pressure Webprocess Poll Interval") set(PLUGIN_RESIDENT_APP_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_LIMIT ${PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_LIMIT} CACHE STRING "Resident App Memory Pressure Networkprocess Limit") set(PLUGIN_RESIDENT_APP_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_POLLINTERVAL ${PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_POLLINTERVAL} CACHE STRING "Resident App Memory Pressure Networkprocess Poll Interval") +set(PLUGIN_RESIDENT_APP_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_LIMIT ${PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_LIMIT} CACHE STRING "Resident App Memory Pressure Service Worker kprocess Limit") +set(PLUGIN_RESIDENT_APP_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_POLLINTERVAL ${PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_POLLINTERVAL} CACHE STRING "Resident App Memory Pressure Service Worker process Poll Interval") set(PLUGIN_RESIDENT_APP_COMPOSITOR "msaa" CACHE STRING "cairo compositor mode for Resident App") set(PLUGIN_SEARCH_AND_DISCOVERY_APP_AUTOSTART "false" CACHE STRING "Automatically start Search&Discovery App plugin") @@ -163,6 +173,8 @@ set(PLUGIN_SEARCH_AND_DISCOVERY_APP_MEMORYPRESSURE_WEBPROCESS_SETTINGS_GPU_FILE set(PLUGIN_SEARCH_AND_DISCOVERY_APP_MEMORYPRESSURE_WEBPROCESS_SETTINGS_POLLINTERVAL ${PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_WEBPROCESS_SETTINGS_POLLINTERVAL} CACHE STRING "Search and Discovery App Memory Pressure Webprocess Poll Interval") set(PLUGIN_SEARCH_AND_DISCOVERY_APP_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_LIMIT ${PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_LIMIT} CACHE STRING "Search and Discovery App Memory Pressure Networkprocess Limit") set(PLUGIN_SEARCH_AND_DISCOVERY_APP_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_POLLINTERVAL ${PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_POLLINTERVAL} CACHE STRING "Search and Discovery App Memory Pressure Networkprocess Poll Interval") +set(PLUGIN_SEARCH_AND_DISCOVERY_APP_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_LIMIT ${PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_LIMIT} CACHE STRING "Search and Discovery App Memory Pressure Service Worker kprocess Limit") +set(PLUGIN_SEARCH_AND_DISCOVERY_APP_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_POLLINTERVAL ${PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_POLLINTERVAL} CACHE STRING "Search and Discovery App Memory Pressure Service Worker process Poll Interval") set(PLUGIN_SEARCH_AND_DISCOVERY_APP_COMPOSITOR "msaa" CACHE STRING "cairo compositor mode for Search&Discovery App") set(PLUGIN_HTML_APP_AUTOSTART "false" CACHE STRING "Automatically start Htmp App plugin") @@ -178,6 +190,8 @@ set(PLUGIN_HTML_APP_MEMORYPRESSURE_WEBPROCESS_SETTINGS_GPU_FILE ${PLUGIN_WEBKITB set(PLUGIN_HTML_APP_MEMORYPRESSURE_WEBPROCESS_SETTINGS_POLLINTERVAL ${PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_WEBPROCESS_SETTINGS_POLLINTERVAL} CACHE STRING "Html App Memory Pressure Webprocess Poll Interval") set(PLUGIN_HTML_APP_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_LIMIT ${PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_LIMIT} CACHE STRING "Html App Memory Pressure Networkprocess Limit") set(PLUGIN_HTML_APP_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_POLLINTERVAL ${PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_POLLINTERVAL} CACHE STRING "Html App Memory Pressure Networkprocess Poll Interval") +set(PLUGIN_HTML_APP_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_LIMIT ${PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_LIMIT} CACHE STRING "Html App Memory Pressure Service Worker kprocess Limit") +set(PLUGIN_HTML_APP_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_POLLINTERVAL ${PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_POLLINTERVAL} CACHE STRING "Html App Memory Pressure Service Worker process Poll Interval") set(PLUGIN_HTML_APP_COMPOSITOR "noaa" CACHE STRING "cairo compositor mode for Html App") set(PLUGIN_LIGHTNING_APP_AUTOSTART "false" CACHE STRING "Automatically start Lightning App plugin") @@ -193,6 +207,8 @@ set(PLUGIN_LIGHTNING_APP_MEMORYPRESSURE_WEBPROCESS_SETTINGS_GPU_FILE ${PLUGIN_WE set(PLUGIN_LIGHTNING_APP_MEMORYPRESSURE_WEBPROCESS_SETTINGS_POLLINTERVAL ${PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_WEBPROCESS_SETTINGS_POLLINTERVAL} CACHE STRING "Lightning App Memory Pressure Webprocess Poll Interval") set(PLUGIN_LIGHTNING_APP_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_LIMIT ${PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_LIMIT} CACHE STRING "Lightning App Memory Pressure Networkprocess Limit") set(PLUGIN_LIGHTNING_APP_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_POLLINTERVAL ${PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_POLLINTERVAL} CACHE STRING "Lightning App Memory Pressure Networkprocess Poll Interval") +set(PLUGIN_LIGHTNING_APP_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_LIMIT ${PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_LIMIT} CACHE STRING "Lightning App Memory Pressure Service Worker kprocess Limit") +set(PLUGIN_LIGHTNING_APP_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_POLLINTERVAL ${PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_POLLINTERVAL} CACHE STRING "Lightning App Memory Pressure Service Worker process Poll Interval") set(PLUGIN_LIGHTNING_APP_COMPOSITOR "noaa" CACHE STRING "cairo compositor mode for Lightning App") set(PLUGIN_JSPP_AUTOSTART "false" CACHE STRING "Automatically start JSPP plugin") @@ -207,6 +223,8 @@ set(PLUGIN_JSPP_MEMORYPRESSURE_WEBPROCESS_SETTINGS_GPU_FILE ${PLUGIN_WEBKITBROWS set(PLUGIN_JSPP_MEMORYPRESSURE_WEBPROCESS_SETTINGS_POLLINTERVAL ${PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_WEBPROCESS_SETTINGS_POLLINTERVAL} CACHE STRING "JSPP App Memory Pressure Webprocess Poll Interval") set(PLUGIN_JSPP_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_LIMIT ${PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_LIMIT} CACHE STRING "JSPP App Memory Pressure Networkprocess Limit") set(PLUGIN_JSPP_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_POLLINTERVAL ${PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_POLLINTERVAL} CACHE STRING "JSPP App Memory Pressure Networkprocess Poll Interval") +set(PLUGIN_JSPP_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_LIMIT ${PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_LIMIT} CACHE STRING "JSPP App Memory Pressure Service Worker kprocess Limit") +set(PLUGIN_JSPP_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_POLLINTERVAL ${PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_POLLINTERVAL} CACHE STRING "JSPP App Memory Pressure Service Worker process Poll Interval") set(PLUGIN_JSPP_STARTURL "about:blank" CACHE STRING "JSPP default URL to use") set(PLUGIN_AMAZON_AUTOSTART "false" CACHE STRING "Automatically start Amazon plugin") @@ -221,6 +239,8 @@ set(PLUGIN_AMAZON_MEMORYPRESSURE_WEBPROCESS_SETTINGS_GPU_FILE ${PLUGIN_WEBKITBRO set(PLUGIN_AMAZON_MEMORYPRESSURE_WEBPROCESS_SETTINGS_POLLINTERVAL ${PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_WEBPROCESS_SETTINGS_POLLINTERVAL} CACHE STRING "Amazon App Memory Pressure Webprocess Poll Interval") set(PLUGIN_AMAZON_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_LIMIT ${PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_LIMIT} CACHE STRING "Amazon App Memory Pressure Networkprocess Limit") set(PLUGIN_AMAZON_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_POLLINTERVAL ${PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_POLLINTERVAL} CACHE STRING "Amazon App Memory Pressure Networkprocess Poll Interval") +set(PLUGIN_AMAZON_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_LIMIT ${PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_LIMIT} CACHE STRING "Amazon App Memory Pressure Service Worker kprocess Limit") +set(PLUGIN_AMAZON_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_POLLINTERVAL ${PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_POLLINTERVAL} CACHE STRING "Amazon App Memory Pressure Service Worker process Poll Interval") find_package(${NAMESPACE}Plugins REQUIRED) find_package(${NAMESPACE}Definitions REQUIRED) diff --git a/WebKitBrowser/HtmlApp.conf.in b/WebKitBrowser/HtmlApp.conf.in index abbffda7f7..678681b818 100644 --- a/WebKitBrowser/HtmlApp.conf.in +++ b/WebKitBrowser/HtmlApp.conf.in @@ -67,6 +67,7 @@ memory = JSON() webprocesssettings = JSON() networkprocesssettings = JSON() +serviceworkerprocesssettings = JSON() if ("@PLUGIN_HTML_APP_MEMORYPRESSURE_WEBPROCESS_SETTINGS_LIMIT@ OR (@PLUGIN_HTML_APP_MEMORYPRESSURE_WEBPROCESS_SETTINGS_GPU_LIMIT@ AND @PLUGIN_HTML_APP_MEMORYPRESSURE_WEBPROCESS_SETTINGS_GPU_FILE@) OR @PLUGIN_HTML_APP_MEMORYPRESSURE_WEBPROCESS_SETTINGS_POLLINTERVAL@"): @@ -89,5 +90,12 @@ if ("@PLUGIN_HTML_APP_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_LIMIT@ AND @PLUGIN_ networkprocesssettings.add("pollinterval", "@PLUGIN_HTML_APP_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_POLLINTERVAL@") memory.add("networkprocesssettings", networkprocesssettings) +if ("@PLUGIN_HTML_APP_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_LIMIT@ AND @PLUGIN_HTML_APP_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_POLLINTERVAL@"): + if ("@PLUGIN_HTML_APP_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_LIMIT@"): + serviceworkerprocesssettings.add("limit", "@PLUGIN_HTML_APP_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_LIMIT@") + if ("@PLUGIN_HTML_APP_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_POLLINTERVAL@"): + serviceworkerprocesssettings.add("pollinterval", "@PLUGIN_HTML_APP_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_POLLINTERVAL@") +memory.add("serviceworkerprocesssettings", serviceworkerprocesssettings) + configuration.add("memory", memory) diff --git a/WebKitBrowser/JSPP.conf.in b/WebKitBrowser/JSPP.conf.in index 58277c489a..19a2e26bd7 100644 --- a/WebKitBrowser/JSPP.conf.in +++ b/WebKitBrowser/JSPP.conf.in @@ -119,6 +119,7 @@ memory = JSON() webprocesssettings = JSON() networkprocesssettings = JSON() +serviceworkerprocesssettings = JSON() if ("@PLUGIN_JSPP_MEMORYPRESSURE_WEBPROCESS_SETTINGS_LIMIT@ OR (@PLUGIN_JSPP_MEMORYPRESSURE_WEBPROCESS_SETTINGS_GPU_LIMIT@ AND @PLUGIN_JSPP_MEMORYPRESSURE_WEBPROCESS_SETTINGS_GPU_FILE@) OR @PLUGIN_JSPP_MEMORYPRESSURE_WEBPROCESS_SETTINGS_POLLINTERVAL@"): @@ -140,5 +141,13 @@ if ("@PLUGIN_JSPP_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_LIMIT@ OR @PLUGIN_JSPP_ if ("@PLUGIN_JSPP_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_POLLINTERVAL@"): networkprocesssettings.add("pollinterval", "@PLUGIN_JSPP_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_POLLINTERVAL@") memory.add("networkprocesssettings", networkprocesssettings) + +if ("@PLUGIN_JSPP_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_LIMIT@ AND @PLUGIN_JSPP_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_POLLINTERVAL@"): + if ("@PLUGIN_JSPP_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_LIMIT@"): + serviceworkerprocesssettings.add("limit", "@PLUGIN_JSPP_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_LIMIT@") + if ("@PLUGIN_JSPP_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_POLLINTERVAL@"): + serviceworkerprocesssettings.add("pollinterval", "@PLUGIN_JSPP_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_POLLINTERVAL@") +memory.add("serviceworkerprocesssettings", serviceworkerprocesssettings) + configuration.add("memory", memory) diff --git a/WebKitBrowser/LightningApp.conf.in b/WebKitBrowser/LightningApp.conf.in index b7ee80352e..382f1e1c5d 100644 --- a/WebKitBrowser/LightningApp.conf.in +++ b/WebKitBrowser/LightningApp.conf.in @@ -67,6 +67,7 @@ memory = JSON() webprocesssettings = JSON() networkprocesssettings = JSON() +serviceworkerprocesssettings = JSON() if ("@PLUGIN_LIGHTNING_APP_MEMORYPRESSURE_WEBPROCESS_SETTINGS_LIMIT@ OR (@PLUGIN_LIGHTNING_APP_MEMORYPRESSURE_WEBPROCESS_SETTINGS_GPU_LIMIT@ AND @PLUGIN_LIGHTNING_APP_MEMORYPRESSURE_WEBPROCESS_SETTINGS_GPU_FILE@) OR @PLUGIN_LIGHTNING_APP_MEMORYPRESSURE_WEBPROCESS_SETTINGS_POLLINTERVAL@"): @@ -88,4 +89,12 @@ if ("@PLUGIN_LIGHTNING_APP_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_LIMIT@ AND @PL if ("@PLUGIN_LIGHTNING_APP_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_POLLINTERVAL@"): networkprocesssettings.add("pollinterval", "@PLUGIN_LIGHTNING_APP_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_POLLINTERVAL@") memory.add("networkprocesssettings", networkprocesssettings) + +if ("@PLUGIN_LIGHTNING_APP_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_LIMIT@ AND @PLUGIN_LIGHTNING_APP_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_POLLINTERVAL@"): + if ("@PLUGIN_LIGHTNING_APP_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_LIMIT@"): + serviceworkerprocesssettings.add("limit", "@PLUGIN_LIGHTNING_APP_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_LIMIT@") + if ("@PLUGIN_LIGHTNING_APP_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_POLLINTERVAL@"): + serviceworkerprocesssettings.add("pollinterval", "@PLUGIN_LIGHTNING_APP_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_POLLINTERVAL@") +memory.add("serviceworkerprocesssettings", serviceworkerprocesssettings) + configuration.add("memory", memory) diff --git a/WebKitBrowser/ResidentApp.conf.in b/WebKitBrowser/ResidentApp.conf.in index b10d6efa90..69208ebbc0 100644 --- a/WebKitBrowser/ResidentApp.conf.in +++ b/WebKitBrowser/ResidentApp.conf.in @@ -62,6 +62,7 @@ memory = JSON() webprocesssettings = JSON() networkprocesssettings = JSON() +serviceworkerprocesssettings = JSON() if ("@PLUGIN_RESIDENT_APP_MEMORYPRESSURE_WEBPROCESS_SETTINGS_LIMIT@ OR (@PLUGIN_RESIDENT_APP_MEMORYPRESSURE_WEBPROCESS_SETTINGS_GPU_LIMIT@ AND @PLUGIN_RESIDENT_APP_MEMORYPRESSURE_WEBPROCESS_SETTINGS_GPU_FILE@) OR @PLUGIN_RESIDENT_APP_MEMORYPRESSURE_WEBPROCESS_SETTINGS_POLLINTERVAL@"): @@ -83,4 +84,12 @@ if ("@PLUGIN_RESIDENT_APP_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_LIMIT@ AND @PLU if ("@PLUGIN_RESIDENT_APP_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_POLLINTERVAL@"): networkprocesssettings.add("pollinterval", "@PLUGIN_RESIDENT_APP_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_POLLINTERVAL@") memory.add("networkprocesssettings", networkprocesssettings) + +if ("@PLUGIN_RESIDENT_APP_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_LIMIT@ AND @PLUGIN_RESIDENT_APP_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_POLLINTERVAL@"): + if ("@PLUGIN_RESIDENT_APP_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_LIMIT@"): + serviceworkerprocesssettings.add("limit", "@PLUGIN_RESIDENT_APP_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_LIMIT@") + if ("@PLUGIN_RESIDENT_APP_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_POLLINTERVAL@"): + serviceworkerprocesssettings.add("pollinterval", "@PLUGIN_RESIDENT_APP_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_POLLINTERVAL@") +memory.add("serviceworkerprocesssettings", serviceworkerprocesssettings) + configuration.add("memory", memory) diff --git a/WebKitBrowser/SearchAndDiscoveryApp.conf.in b/WebKitBrowser/SearchAndDiscoveryApp.conf.in index e4e4e6fb75..cadea0216f 100644 --- a/WebKitBrowser/SearchAndDiscoveryApp.conf.in +++ b/WebKitBrowser/SearchAndDiscoveryApp.conf.in @@ -64,6 +64,7 @@ memory = JSON() webprocesssettings = JSON() networkprocesssettings = JSON() +serviceworkerprocesssettings = JSON() if ("@PLUGIN_SEARCH_AND_DISCOVERY_APP_MEMORYPRESSURE_WEBPROCESS_SETTINGS_LIMIT@ OR (@PLUGIN_SEARCH_AND_DISCOVERY_APP_MEMORYPRESSURE_WEBPROCESS_SETTINGS_GPU_LIMIT@ AND @PLUGIN_SEARCH_AND_DISCOVERY_APP_MEMORYPRESSURE_WEBPROCESS_SETTINGS_GPU_FILE@) OR @PLUGIN_SEARCH_AND_DISCOVERY_APP_MEMORYPRESSURE_WEBPROCESS_SETTINGS_POLLINTERVAL@"): if ("@PLUGIN_SEARCH_AND_DISCOVERY_APP_MEMORYPRESSURE_WEBPROCESS_SETTINGS_LIMIT@"): @@ -84,4 +85,12 @@ if ("@PLUGIN_SEARCH_AND_DISCOVERY_APP_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_LIM if ("@PLUGIN_SEARCH_AND_DISCOVERY_APP_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_POLLINTERVAL@"): networkprocesssettings.add("pollinterval", "@PLUGIN_SEARCH_AND_DISCOVERY_APP_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_POLLINTERVAL@") memory.add("networkprocesssettings", networkprocesssettings) + +if ("@PLUGIN_SEARCH_AND_DISCOVERY_APP_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_LIMIT@ AND @PLUGIN_SEARCH_AND_DISCOVERY_APP_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_POLLINTERVAL@"): + if ("@PLUGIN_SEARCH_AND_DISCOVERY_APP_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_LIMIT@"): + serviceworkerprocesssettings.add("limit", "@PLUGIN_SEARCH_AND_DISCOVERY_APP_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_LIMIT@") + if ("@PLUGIN_SEARCH_AND_DISCOVERY_APP_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_POLLINTERVAL@"): + serviceworkerprocesssettings.add("pollinterval", "@PLUGIN_SEARCH_AND_DISCOVERY_APP_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_POLLINTERVAL@") +memory.add("serviceworkerprocesssettings", serviceworkerprocesssettings) + configuration.add("memory", memory) diff --git a/WebKitBrowser/WebKitBrowser.conf.in b/WebKitBrowser/WebKitBrowser.conf.in index 1c0312d66c..067cad5a60 100644 --- a/WebKitBrowser/WebKitBrowser.conf.in +++ b/WebKitBrowser/WebKitBrowser.conf.in @@ -77,6 +77,7 @@ memory = JSON() webprocesssettings = JSON() networkprocesssettings = JSON() +serviceworkerprocesssettings = JSON() if ("@PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_WEBPROCESS_SETTINGS_LIMIT@ OR (@PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_WEBPROCESS_SETTINGS_GPU_LIMIT@ AND @PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_WEBPROCESS_SETTINGS_GPU_FILE@) OR @PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_WEBPROCESS_SETTINGS_POLLINTERVAL@"): @@ -98,4 +99,12 @@ if ("@PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_LIMIT@ AND @PL if ("@PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_POLLINTERVAL@"): networkprocesssettings.add("pollinterval", "@PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_POLLINTERVAL@") memory.add("networkprocesssettings", networkprocesssettings) + +if ("@PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_LIMIT@ AND @PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_POLLINTERVAL@"): + if ("@PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_LIMIT@"): + serviceworkerprocesssettings.add("limit", "@PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_LIMIT@") + if ("@PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_POLLINTERVAL@"): + serviceworkerprocesssettings.add("pollinterval", "@PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_POLLINTERVAL@") +memory.add("serviceworkerprocesssettings", serviceworkerprocesssettings) + configuration.add("memory", memory) diff --git a/WebKitBrowser/WebKitImplementation.cpp b/WebKitBrowser/WebKitImplementation.cpp index cdea9ba177..c46d3db6eb 100644 --- a/WebKitBrowser/WebKitImplementation.cpp +++ b/WebKitBrowser/WebKitImplementation.cpp @@ -543,9 +543,11 @@ static GSourceFuncs _handlerIntervention = : Core::JSON::Container() , WebProcessSettings() , NetworkProcessSettings() + , ServiceWorkerProcessSettings() { Add(_T("webprocesssettings"), &WebProcessSettings); Add(_T("networkprocesssettings"), &NetworkProcessSettings); + Add(_T("serviceworkerprocesssettings"), &ServiceWorkerProcessSettings); } ~MemorySettings() { @@ -554,6 +556,7 @@ static GSourceFuncs _handlerIntervention = public: WebProcess WebProcessSettings; Settings NetworkProcessSettings; + WebProcess ServiceWorkerProcessSettings; }; public: @@ -2855,8 +2858,30 @@ static GSourceFuncs _handlerIntervention = webkit_memory_pressure_settings_set_poll_interval(memoryPressureSettings, _config.Memory.WebProcessSettings.PollInterval.Value()); } - // Pass web process memory pressure settings to WebKitWebContext constructor - wkContext = WEBKIT_WEB_CONTEXT(g_object_new(WEBKIT_TYPE_WEB_CONTEXT, "website-data-manager", websiteDataManager, "memory-pressure-settings", memoryPressureSettings, nullptr)); + if (_config.Memory.ServiceWorkerProcessSettings.IsSet() == true) { + WebKitMemoryPressureSettings* serviceWorkerMemoryPressureSettings = webkit_memory_pressure_settings_new(); + + if (_config.Memory.ServiceWorkerProcessSettings.Limit.IsSet() == true) { + webkit_memory_pressure_settings_set_memory_limit(serviceWorkerMemoryPressureSettings, _config.Memory.ServiceWorkerProcessSettings.Limit.Value()); + } + if (_config.Memory.ServiceWorkerProcessSettings.PollInterval.IsSet() == true) { + webkit_memory_pressure_settings_set_poll_interval(serviceWorkerMemoryPressureSettings, _config.Memory.ServiceWorkerProcessSettings.PollInterval.Value()); + } + + // Pass web and service worker process memory pressure settings to WebKitWebContext constructor + wkContext = WEBKIT_WEB_CONTEXT(g_object_new(WEBKIT_TYPE_WEB_CONTEXT, + "website-data-manager", websiteDataManager, + "memory-pressure-settings", memoryPressureSettings, + "service-worker-memory-pressure-settings", serviceWorkerMemoryPressureSettings, + nullptr)); + webkit_memory_pressure_settings_free(serviceWorkerMemoryPressureSettings); + } else { + // Pass web process memory pressure settings to WebKitWebContext constructor + wkContext = WEBKIT_WEB_CONTEXT(g_object_new(WEBKIT_TYPE_WEB_CONTEXT, + "website-data-manager", websiteDataManager, + "memory-pressure-settings", memoryPressureSettings, + nullptr)); + } webkit_memory_pressure_settings_free(memoryPressureSettings); } else #endif