diff --git a/WebKitBrowser/BrowserConsoleLog.h b/WebKitBrowser/BrowserConsoleLog.h index 7017253d0c..1bc76276f5 100644 --- a/WebKitBrowser/BrowserConsoleLog.h +++ b/WebKitBrowser/BrowserConsoleLog.h @@ -37,7 +37,11 @@ class BrowserConsoleLog { BrowserConsoleLog(const string& prefix, const string& message, const uint64_t line, const uint64_t column) { _text = '[' + prefix + "][" + Core::NumberType(line).Text() + ',' + Core::NumberType(column).Text() + ']' + message; +#ifdef __CORE_MESSAGING__ + const uint16_t maxStringLength = Messaging::MessageUnit::DataSize - 1; +#else const uint16_t maxStringLength = Trace::TRACINGBUFFERSIZE - 1; +#endif if (_text.length() > maxStringLength) { _text = _text.substr(0, maxStringLength); } @@ -46,7 +50,11 @@ class BrowserConsoleLog { BrowserConsoleLog(const string& prefix, const WKStringRef message, const uint64_t line, const uint64_t column) { _text = '[' + prefix + "][" + Core::NumberType(line).Text() + ',' + Core::NumberType(column).Text() + ']' + WebKit::Utils::WKStringToString(message); +#ifdef __CORE_MESSAGING__ + const uint16_t maxStringLength = Messaging::MessageUnit::DataSize - 1; +#else const uint16_t maxStringLength = Trace::TRACINGBUFFERSIZE - 1; +#endif if (_text.length() > maxStringLength) { _text = _text.substr(0, maxStringLength); } diff --git a/WebKitBrowser/CHANGELOG.md b/WebKitBrowser/CHANGELOG.md index c3cd59e1a0..aa75fed0b3 100644 --- a/WebKitBrowser/CHANGELOG.md +++ b/WebKitBrowser/CHANGELOG.md @@ -15,6 +15,11 @@ All notable changes to this RDK Service will be documented in this file. * Changes in CHANGELOG should be updated when commits are added to the main or release branches. There should be one CHANGELOG entry per JIRA Ticket. This is not enforced on sprint branches since there could be multiple changes for the same JIRA ticket during development. * For more details, refer to [versioning](https://github.com/rdkcentral/rdkservices#versioning) section under Main README. +## [1.1.22] - 2024-07-02 +### Changed +- Improve Thunder R4 compatibility +- Enable/disable service worker support at runtime +- Workaround crash in bmalloc's BMScavenger during shutdown ## [1.1.21] - 2024-04-09 ### Changed diff --git a/WebKitBrowser/CMakeLists.txt b/WebKitBrowser/CMakeLists.txt index 8d0ecf5b5c..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) @@ -254,6 +274,10 @@ if(NOT WEBKIT_GLIB_API) target_sources(${PLUGIN_WEBKITBROWSER_IMPLEMENTATION} PRIVATE InjectedBundle/Utils.cpp) endif() +# This is a temporary solution. Normally we should leave this to the framework. +# Do not replicate for other plugins. +target_link_options(${PLUGIN_WEBKITBROWSER_IMPLEMENTATION} PRIVATE "-Wl,-z,nodelete") + target_link_libraries(${PLUGIN_WEBKITBROWSER_IMPLEMENTATION} PRIVATE ${NAMESPACE}Plugins::${NAMESPACE}Plugins diff --git a/WebKitBrowser/CookieJar.cpp b/WebKitBrowser/CookieJar.cpp index 432a9d6480..bb24c8da1c 100644 --- a/WebKitBrowser/CookieJar.cpp +++ b/WebKitBrowser/CookieJar.cpp @@ -106,7 +106,7 @@ static std::vector compress(const std::string& str) result[3] = (nbytes & 0x000000ff); break; case Z_MEM_ERROR: - TRACE_GLOBAL(Trace::Error,(_T("Z_MEM_ERROR: Not enough memory"))); + SYSLOG(Logging::Error,(_T("Z_MEM_ERROR: Not enough memory"))); result.resize(0); break; case Z_BUF_ERROR: @@ -126,7 +126,7 @@ static std::string uncompress(const std::vector& in) { if (nbytes < 4 || std::any_of(in.cbegin(), in.cend(), [](int v) {return v != 0;})) { - TRACE_GLOBAL(Trace::Error,(_T("Input data is corrupted"))); + SYSLOG(Logging::Error,(_T("Input data is corrupted"))); } return result; } @@ -146,11 +146,11 @@ static std::string uncompress(const std::vector& in) len *= 2; break; case Z_MEM_ERROR: - TRACE_GLOBAL(Trace::Error,(_T("Z_MEM_ERROR: Not enough memory"))); + SYSLOG(Logging::Error,(_T("Z_MEM_ERROR: Not enough memory"))); result.resize(0); break; case Z_DATA_ERROR: - TRACE_GLOBAL(Trace::Error,(_T("Z_DATA_ERROR: Input data is corrupted"))); + SYSLOG(Logging::Error,(_T("Z_DATA_ERROR: Input data is corrupted"))); result.resize(0); break; } @@ -201,7 +201,7 @@ struct CookieJar::CookieJarPrivate if (rc != Core::ERROR_NONE) { - TRACE_GLOBAL(Trace::Error,(_T("Encryption failed, rc = %u"), rc)); + SYSLOG(Logging::Error,(_T("Encryption failed, rc = %u"), rc)); } else { @@ -220,7 +220,7 @@ struct CookieJar::CookieJarPrivate if (rc != Core::ERROR_NONE) { - TRACE_GLOBAL(Trace::Error,(_T("Decryption failed, rc = %u"), rc)); + SYSLOG(Logging::Error,(_T("Decryption failed, rc = %u"), rc)); } else { @@ -232,7 +232,7 @@ struct CookieJar::CookieJarPrivate if (actualChecksum != checksum) { rc = Core::ERROR_GENERAL; - TRACE_GLOBAL(Trace::Error,(_T("Checksum does not match: actual=%d expected=%d"), actualChecksum, checksum)); + SYSLOG(Logging::Error,(_T("Checksum does not match: actual=%d expected=%d"), actualChecksum, checksum)); } else { diff --git a/WebKitBrowser/Extension/BridgeObject.cpp b/WebKitBrowser/Extension/BridgeObject.cpp index 2b83c507c3..06355b12c6 100644 --- a/WebKitBrowser/Extension/BridgeObject.cpp +++ b/WebKitBrowser/Extension/BridgeObject.cpp @@ -65,7 +65,7 @@ static void CallBridge(WebKitWebPage* page, const char* scriptSrc, WebKitUserMes gsize decodedLen = 0; gchar *decoded = reinterpret_cast(g_base64_decode(payloadPtr, &decodedLen)); if (g_utf8_validate(decoded, decodedLen, nullptr) == FALSE) { - TRACE_GLOBAL(Trace::Error, (_T("Decoded message is not a valid UTF8 string!"))); + SYSLOG(Logging::Error, (_T("Decoded message is not a valid UTF8 string!"))); gchar *tmp = decoded; #if GLIB_CHECK_VERSION(2, 52, 0) decoded = g_utf8_make_valid(tmp, decodedLen); diff --git a/WebKitBrowser/Extension/Module.h b/WebKitBrowser/Extension/Module.h index d56663c027..dfc4bb0983 100644 --- a/WebKitBrowser/Extension/Module.h +++ b/WebKitBrowser/Extension/Module.h @@ -25,7 +25,11 @@ #include #include +#ifdef __CORE_MESSAGING__ +#include +#else #include +#endif #undef EXTERNAL #define EXTERNAL diff --git a/WebKitBrowser/Extension/ProcessInfo.cpp b/WebKitBrowser/Extension/ProcessInfo.cpp index 999e072ee4..a561a3d9bc 100644 --- a/WebKitBrowser/Extension/ProcessInfo.cpp +++ b/WebKitBrowser/Extension/ProcessInfo.cpp @@ -40,9 +40,9 @@ void SetProcessName() #error("No implementation available to set process name on this platform") #endif if (0 != ret ) { - TRACE_GLOBAL(Trace::Error, (_T("Setting process name to '%s' FAILED with code %d\n"), processName.c_str(), ret)); + SYSLOG(Logging::Error, (_T("Setting process name to '%s' FAILED with code %d\n"), processName.c_str(), ret)); } else { - TRACE_GLOBAL(Trace::Error, (_T("Setting process name to '%s' SUCCESS\n"), processName.c_str())); + TRACE_GLOBAL(Trace::Information, (_T("Setting process name to '%s' SUCCESS\n"), processName.c_str())); } } diff --git a/WebKitBrowser/Extension/RequestHeaders.cpp b/WebKitBrowser/Extension/RequestHeaders.cpp index 257d9d7f08..3dad793d03 100644 --- a/WebKitBrowser/Extension/RequestHeaders.cpp +++ b/WebKitBrowser/Extension/RequestHeaders.cpp @@ -53,9 +53,9 @@ bool ParseHeaders(const string& json, Headers& out) } return true; } else { - TRACE_GLOBAL(Trace::Error, - (_T("Failed to parse headers array, error='%s', json='%s'\n"), - (error.IsSet() ? error.Value().Message().c_str() : "unknown"), json.c_str())); + SYSLOG(Logging::Error, + (_T("Failed to parse headers array, error='%s', json='%s'\n"), + (error.IsSet() ? error.Value().Message().c_str() : "unknown"), json.c_str())); } return false; diff --git a/WebKitBrowser/Extension/main.cpp b/WebKitBrowser/Extension/main.cpp index 5adf09e013..8f9ccd6531 100644 --- a/WebKitBrowser/Extension/main.cpp +++ b/WebKitBrowser/Extension/main.cpp @@ -78,7 +78,9 @@ static class PluginHost { : _engine(Core::ProxyType>::Create()) , _comClient(Core::ProxyType::Create(GetConnectionNode(), Core::ProxyType(_engine))) { +#if !defined(THUNDER_VERSION) || THUNDER_VERSION < 4 || (THUNDER_VERSION == 4 && defined(THUNDER_VERSION_MINOR) && THUNDER_VERSION_MINOR < 4) _engine->Announcements(_comClient->Announcement()); +#endif } ~PluginHost() { @@ -92,10 +94,14 @@ static class PluginHost { // We have something to report back, do so... uint32_t result = _comClient->Open(RPC::CommunicationTimeOut); if (result != Core::ERROR_NONE) { - TRACE(Trace::Error, (_T("Could not open connection to node %s. Error: %s"), _comClient->Source().RemoteId(), Core::NumberType(result).Text())); + SYSLOG(Logging::Error, (_T("Could not open connection to node %s. Error: %s"), _comClient->Source().RemoteId(), Core::NumberType(result).Text())); } else { // Due to the LXC container support all ID's get mapped. For the TraceBuffer, use the host given ID. +#ifdef __CORE_MESSAGING__ + Messaging::MessageUnit::Instance().Open(_comClient->ConnectionId()); +#else Trace::TraceUnit::Instance().Open(_comClient->ConnectionId()); +#endif /* __CORE_MESSAGING__ */ } _extension = WEBKIT_WEB_EXTENSION(g_object_ref(extension)); 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/Testing/Extension/testrunnerextension.cpp b/WebKitBrowser/Testing/Extension/testrunnerextension.cpp index f80e9a9c56..7b17dab732 100644 --- a/WebKitBrowser/Testing/Extension/testrunnerextension.cpp +++ b/WebKitBrowser/Testing/Extension/testrunnerextension.cpp @@ -50,7 +50,8 @@ static bool callEventListener(const std::string& eventName, JSCValue* event) g_warning("TestRunnerJS: Event listener %s not registered", eventName.c_str()); return false; } - jsc_value_function_call(it->second, JSC_TYPE_VALUE, event, G_TYPE_NONE); + JSCValue* ignore = jsc_value_function_call(it->second, JSC_TYPE_VALUE, event, G_TYPE_NONE); + g_object_unref(ignore); return true; } diff --git a/WebKitBrowser/TimeZone/TimeZoneSupport.cpp b/WebKitBrowser/TimeZone/TimeZoneSupport.cpp index 90af3d09ab..30771da9fa 100644 --- a/WebKitBrowser/TimeZone/TimeZoneSupport.cpp +++ b/WebKitBrowser/TimeZone/TimeZoneSupport.cpp @@ -54,7 +54,7 @@ namespace TZ { if (timeZone != tzSupport->_previousTimeZone) { tzSupport->_previousTimeZone = timeZone; timeZone = ":" + timeZone; - SYSLOG(Trace::Information, (_T("TimeZone is updated to \"%s\" from \"%s\" file"), timeZone.c_str(), tzSupport->_tzFile.c_str())); + SYSLOG(Logging::Notification, (_T("TimeZone is updated to \"%s\" from \"%s\" file"), timeZone.c_str(), tzSupport->_tzFile.c_str())); Core::SystemInfo::SetEnvironment(_T("TZ"), _T(timeZone), true); tzset(); } @@ -76,7 +76,7 @@ namespace TZ { void TimeZoneSupport::Initialize() { if(_tzFile.empty()) { - SYSLOG(Trace::Warning, (_T("Invalid file input for TZ update"))); + SYSLOG(Logging::Error, (_T("Invalid file input for TZ update"))); return; } @@ -89,7 +89,7 @@ namespace TZ { _timeZoneFileMonitor = g_file_monitor_file(file, G_FILE_MONITOR_NONE, nullptr, nullptr); _timeZoneFileMonitorId = g_signal_connect(_timeZoneFileMonitor, "changed", reinterpret_cast(HandleTimeZoneFileUpdate), this); - SYSLOG(Trace::Information, (_T("Installed file monitor for \"%s\""), _tzFile.c_str())); + SYSLOG(Logging::Notification, (_T("Installed file monitor for \"%s\""), _tzFile.c_str())); g_object_unref(file); } diff --git a/WebKitBrowser/TimeZone/TimeZoneSupport.h b/WebKitBrowser/TimeZone/TimeZoneSupport.h index 4fccc24d69..c65756ab8f 100644 --- a/WebKitBrowser/TimeZone/TimeZoneSupport.h +++ b/WebKitBrowser/TimeZone/TimeZoneSupport.h @@ -20,7 +20,7 @@ #ifndef __TIMEZONESUPPORTH #define __TIMEZONESUPPORTH -#include "Module.h" +#include "../Extension/Module.h" #include namespace WPEFramework { 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/WebKitBrowser.cpp b/WebKitBrowser/WebKitBrowser.cpp index f12ea5e40f..c2b4476070 100644 --- a/WebKitBrowser/WebKitBrowser.cpp +++ b/WebKitBrowser/WebKitBrowser.cpp @@ -21,7 +21,7 @@ #define API_VERSION_NUMBER_MAJOR 1 #define API_VERSION_NUMBER_MINOR 1 -#define API_VERSION_NUMBER_PATCH 20 +#define API_VERSION_NUMBER_PATCH 22 namespace WPEFramework { @@ -118,7 +118,6 @@ namespace Plugin { _cookieJar = _browser->QueryInterface(); if (_cookieJar) { _cookieJar->Register(&_notification); - Exchange::JBrowserCookieJar::Register(*this, _cookieJar); } _browserScripting = _browser->QueryInterface(); @@ -151,7 +150,6 @@ namespace Plugin { _browserScripting->Release(); } if (_cookieJar) { - Exchange::JBrowserCookieJar::Unregister(*this); _cookieJar->Unregister(&_notification); _cookieJar->Release(); } @@ -279,8 +277,13 @@ namespace Plugin { if (path.empty() == false) { string fullPath = _persistentStoragePath + path; Core::Directory dir(fullPath.c_str()); - if (!dir.Destroy(true)) { - TRACE(Trace::Error, (_T("Failed to delete %s\n"), fullPath.c_str())); +#if defined(THUNDER_VERSION) && THUNDER_VERSION >= 4 + bool success = dir.Destroy(); +#else + bool success = dir.Destroy(true); +#endif + if (!success) { + SYSLOG(Logging::Error, (_T("Failed to delete %s\n"), fullPath.c_str())); result = Core::ERROR_GENERAL; } } @@ -309,6 +312,7 @@ namespace Plugin { { string message(string("{ \"url\": \"") + URL + string("\", \"loaded\": ") + (loaded ? string("true") : string("false")) + string(" }")); TRACE(Trace::Information, (_T("URLChanged: %s"), message.c_str())); + _lastURL.assign(URL); _service->Notify(message); Exchange::JWebBrowser::Event::URLChange(*this, URL, loaded); } @@ -335,7 +339,7 @@ namespace Plugin { void WebKitBrowser::CookieJarChanged() { - Exchange::JBrowserCookieJar::Event::CookieJarChanged(*this); + Notify(_T("cookiejarchanged")); } void WebKitBrowser::StateChange(const PluginHost::IStateControl::state state) @@ -350,6 +354,8 @@ namespace Plugin { { if (connection->Id() == _connectionId) { + TRACE(Trace::Information, (_T("WebKitBrowser::Deactivated: { \"URL\": %.*s }"), 80, _lastURL.c_str())); + ASSERT(_service != nullptr); Core::IWorkerPool::Instance().Submit(PluginHost::IShell::Job::Create(_service, PluginHost::IShell::DEACTIVATED, PluginHost::IShell::FAILURE)); @@ -454,7 +460,11 @@ namespace WebKitBrowser { _children = Core::ProcessInfo::Iterator(_main.Id()); return ((_startTime == TimePoint::min()) || (_main.IsActive() == true) ? 1 : 0) + _children.Count(); } +#if defined(THUNDER_VERSION) && THUNDER_VERSION >= 4 + bool IsOperational() const override +#else const bool IsOperational() const override +#endif { uint32_t requiredProcesses = 0; diff --git a/WebKitBrowser/WebKitBrowser.h b/WebKitBrowser/WebKitBrowser.h index c2cad5f920..eeba30cc45 100644 --- a/WebKitBrowser/WebKitBrowser.h +++ b/WebKitBrowser/WebKitBrowser.h @@ -285,6 +285,7 @@ namespace Plugin { Core::Sink _notification; Core::ProxyPoolType> _jsonBodyDataFactory; string _persistentStoragePath; + string _lastURL; }; } } diff --git a/WebKitBrowser/WebKitImplementation.cpp b/WebKitBrowser/WebKitImplementation.cpp index 8d45555463..9e1e5977bb 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: @@ -623,6 +626,7 @@ static GSourceFuncs _handlerIntervention = , LoggingTarget() , WebAudioEnabled(false) , Testing(false) + , ServiceWorkerEnabled(false) { Add(_T("useragent"), &UserAgent); Add(_T("url"), &URL); @@ -690,6 +694,7 @@ static GSourceFuncs _handlerIntervention = Add(_T("loggingtarget"), &LoggingTarget); Add(_T("webaudio"), &WebAudioEnabled); Add(_T("testing"), &Testing); + Add(_T("serviceworker"), &ServiceWorkerEnabled); } ~Config() { @@ -762,6 +767,7 @@ static GSourceFuncs _handlerIntervention = Core::JSON::String LoggingTarget; Core::JSON::Boolean WebAudioEnabled; Core::JSON::Boolean Testing; + Core::JSON::Boolean ServiceWorkerEnabled; }; class HangDetector @@ -870,7 +876,6 @@ static GSourceFuncs _handlerIntervention = , _view(nullptr) , _guid(Core::Time::Now().Ticks()) , _httpCookieAcceptPolicy(WEBKIT_COOKIE_POLICY_ACCEPT_NO_THIRD_PARTY) - , _webprocessPID(-1) , _extensionPath() , _ignoreLoadFinishedOnce(false) #else @@ -1461,9 +1466,13 @@ static GSourceFuncs _handlerIntervention = #ifdef WEBKIT_GLIB_API WebKitWebContext* context = webkit_web_view_get_context(_view); WebKitCookieManager* manager = webkit_web_context_get_cookie_manager(context); +#if WEBKIT_CHECK_VERSION(2, 42, 0) + webkit_cookie_manager_get_all_cookies(manager, NULL, [](GObject* object, GAsyncResult* result, gpointer user_data) { + GList* cookies_list = webkit_cookie_manager_get_all_cookies_finish(WEBKIT_COOKIE_MANAGER(object), result, nullptr); +#else webkit_cookie_manager_get_cookie_jar(manager, NULL, [](GObject* object, GAsyncResult* result, gpointer user_data) { GList* cookies_list = webkit_cookie_manager_get_cookie_jar_finish(WEBKIT_COOKIE_MANAGER(object), result, nullptr); - +#endif std::vector cookieVector; cookieVector.reserve(g_list_length(cookies_list)); for (GList* it = cookies_list; it != NULL; it = g_list_next(it)) { @@ -1509,7 +1518,7 @@ static GSourceFuncs _handlerIntervention = if (error) { auto errorDomain = WKErrorCopyDomain(error); auto errorDescription = WKErrorCopyLocalizedDescription(error); - TRACE_GLOBAL(Trace::Error, + SYSLOG(Logging::Error, (_T("GetCookies failed, error(code=%d, domain=%s, message=%s)"), WKErrorGetErrorCode(error), WKStringToString(errorDomain).c_str(), @@ -1579,8 +1588,11 @@ static GSourceFuncs _handlerIntervention = WebKitWebContext* context = webkit_web_view_get_context(_view); WebKitCookieManager* manager = webkit_web_context_get_cookie_manager(context); +#if WEBKIT_CHECK_VERSION(2, 42, 0) + webkit_cookie_manager_replace_cookies(manager, g_list_reverse(cookies_list), nullptr, nullptr, nullptr); +#else webkit_cookie_manager_set_cookie_jar(manager, g_list_reverse(cookies_list), nullptr, nullptr, nullptr); - +#endif g_list_free_full(cookies_list, reinterpret_cast(soup_cookie_free)); #else auto toWKCookie = [](SoupCookie* cookie) -> WKCookieRef @@ -1993,7 +2005,7 @@ static GSourceFuncs _handlerIntervention = Core::JSON::ArrayType array; if (!array.FromString(language, error)) { - TRACE(Trace::Error, + SYSLOG(Logging::Error, (_T("Failed to parse languages array, error='%s', array='%s'\n"), (error.IsSet() ? error.Value().Message().c_str() : "unknown"), language.c_str())); return Core::ERROR_GENERAL; @@ -2670,32 +2682,37 @@ static GSourceFuncs _handlerIntervention = static void loadFailedCallback(WebKitWebView*, WebKitLoadEvent loadEvent, const gchar* failingURI, GError* error, WebKitImplementation* browser) { string message(string("{ \"url\": \"") + failingURI + string("\", \"Error message\": \"") + error->message + string("\", \"loadEvent\":") + Core::NumberType(loadEvent).Text() + string(" }")); - SYSLOG(Trace::Information, (_T("LoadFailed: %s"), message.c_str())); + SYSLOG(Logging::Notification, (_T("LoadFailed: %s"), message.c_str())); if (g_error_matches(error, WEBKIT_NETWORK_ERROR, WEBKIT_NETWORK_ERROR_CANCELLED)) { browser->_ignoreLoadFinishedOnce = true; return; } browser->OnLoadFailed(failingURI); } + static void postExitJob() + { + struct ExitJob : public Core::IDispatch + { + virtual void Dispatch() { exit(1); } + }; + + Core::IWorkerPool::Instance().Submit(Core::ProxyType(Core::ProxyType::Create())); + } static void webProcessTerminatedCallback(VARIABLE_IS_NOT_USED WebKitWebView* webView, WebKitWebProcessTerminationReason reason, WebKitImplementation* browser) { switch (reason) { case WEBKIT_WEB_PROCESS_CRASHED: - SYSLOG(Trace::Fatal, (_T("CRASH: WebProcess crashed: exiting ..."))); + SYSLOG(Logging::Fatal, (_T("CRASH: WebProcess crashed: exiting ..."))); break; case WEBKIT_WEB_PROCESS_EXCEEDED_MEMORY_LIMIT: - SYSLOG(Trace::Fatal, (_T("CRASH: WebProcess terminated due to memory limit: exiting ..."))); + SYSLOG(Logging::Fatal, (_T("CRASH: WebProcess terminated due to memory limit: exiting ..."))); break; case WEBKIT_WEB_PROCESS_TERMINATED_BY_API: - SYSLOG(Trace::Fatal, (_T("CRASH: WebProcess terminated by API"))); + SYSLOG(Logging::Fatal, (_T("CRASH: WebProcess terminated by API"))); break; } g_signal_handlers_block_matched(webView, G_SIGNAL_MATCH_DATA, 0, 0, nullptr, nullptr, browser); - struct ExitJob : public Core::IDispatch - { - virtual void Dispatch() { exit(1); } - }; - Core::IWorkerPool::Instance().Submit(Core::proxy_cast(Core::ProxyType::Create())); + postExitJob(); } static void closeCallback(VARIABLE_IS_NOT_USED WebKitWebView* webView, WebKitImplementation* browser) { @@ -2853,8 +2870,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 @@ -2895,7 +2934,11 @@ static GSourceFuncs _handlerIntervention = } if (!_config.CertificateCheck) { +#if WEBKIT_CHECK_VERSION(2, 38, 0) + webkit_website_data_manager_set_tls_errors_policy(webkit_web_context_get_website_data_manager(wkContext), WEBKIT_TLS_ERRORS_POLICY_IGNORE); +#else webkit_web_context_set_tls_errors_policy(wkContext, WEBKIT_TLS_ERRORS_POLICY_IGNORE); +#endif } auto* languages = static_cast(g_new0(char*, _config.Languages.Length() + 1)); @@ -2970,6 +3013,10 @@ static GSourceFuncs _handlerIntervention = "allow-running-of-insecure-content", !enableWebSecurity, "allow-display-of-insecure-content", !enableWebSecurity, nullptr); #endif + // Service Worker support + g_object_set(G_OBJECT(preferences), + "enable-service-worker", _config.ServiceWorkerEnabled.Value(), nullptr); + _view = WEBKIT_WEB_VIEW(g_object_new(WEBKIT_TYPE_WEB_VIEW, "backend", webkit_web_view_backend_new(wpe_view_backend_create(), nullptr, nullptr), "web-context", wkContext, @@ -3330,7 +3377,7 @@ static GSourceFuncs _handlerIntervention = gchar* scriptContent; auto success = g_file_get_contents(path.c_str(), &scriptContent, nullptr, nullptr); if (!success) { - SYSLOG(Trace::Error, (_T("Unable to read user script '%s'"), path.c_str())); + SYSLOG(Logging::Error, (_T("Unable to read user script '%s'"), path.c_str())); return; } AddUserScriptImpl(scriptContent, false); @@ -3406,6 +3453,14 @@ static GSourceFuncs _handlerIntervention = #endif } + pid_t GetWebGetProcessIdentifier() { +#ifdef WEBKIT_GLIB_API + return webkit_web_view_get_web_process_identifier(_view); +#else + return WKPageGetProcessIdentifier(GetPage()); +#endif + } + void DidReceiveWebProcessResponsivenessReply(bool isWebProcessResponsive) { if (_config.WatchDogHangThresholdInSeconds.Value() == 0 || _config.WatchDogCheckTimeoutInSeconds.Value() == 0) @@ -3423,15 +3478,11 @@ static GSourceFuncs _handlerIntervention = if (isWebProcessResponsive && _unresponsiveReplyNum == 0) return; + pid_t webprocessPID = GetWebGetProcessIdentifier(); #ifdef WEBKIT_GLIB_API std::string activeURL(webkit_web_view_get_uri(_view)); - if (_webprocessPID == -1) { - _webprocessPID = webkit_web_view_get_web_process_identifier(_view); - } - pid_t webprocessPID = _webprocessPID; #else std::string activeURL = GetPageActiveURL(GetPage()); - pid_t webprocessPID = WKPageGetProcessIdentifier(GetPage()); #endif if (isWebProcessResponsive) { @@ -3453,7 +3504,7 @@ static GSourceFuncs _handlerIntervention = _unresponsiveReplyNum = kWebProcessUnresponsiveReplyDefaultLimit; Logging::DumpSystemFiles(webprocessPID); if (syscall(__NR_tgkill, webprocessPID, webprocessPID, SIGFPE) == -1) { - SYSLOG(Trace::Error, (_T("tgkill failed, signal=%d process=%u errno=%d (%s)"), SIGFPE, webprocessPID, errno, strerror(errno))); + SYSLOG(Logging::Error, (_T("tgkill failed, signal=%d process=%u errno=%d (%s)"), SIGFPE, webprocessPID, errno, strerror(errno))); } } else { DeactivateBrowser(PluginHost::IShell::FAILURE); @@ -3465,7 +3516,7 @@ static GSourceFuncs _handlerIntervention = Logging::DumpSystemFiles(webprocessPID); if (syscall(__NR_tgkill, webprocessPID, webprocessPID, SIGFPE) == -1) { - SYSLOG(Trace::Error, (_T("tgkill failed, signal=%d process=%u errno=%d (%s)"), SIGFPE, webprocessPID, errno, strerror(errno))); + SYSLOG(Logging::Error, (_T("tgkill failed, signal=%d process=%u errno=%d (%s)"), SIGFPE, webprocessPID, errno, strerror(errno))); } } else if (_unresponsiveReplyNum == (2 * kWebProcessUnresponsiveReplyDefaultLimit)) { DeactivateBrowser(PluginHost::IShell::WATCHDOG_EXPIRED); @@ -3503,7 +3554,9 @@ static GSourceFuncs _handlerIntervention = void DeactivateBrowser(PluginHost::IShell::reason reason) { ASSERT(_service != nullptr); - Core::IWorkerPool::Instance().Submit(PluginHost::IShell::Job::Create(_service, PluginHost::IShell::DEACTIVATED, reason)); + const char *reasonStr = Core::EnumerateType(reason).Data(); + SYSLOG(Logging::Fatal, (_T("Posting a job to exit, reason - %s"), (reasonStr ? reasonStr : ""))); + postExitJob(); } private: @@ -3519,7 +3572,6 @@ static GSourceFuncs _handlerIntervention = WebKitWebView* _view; uint64_t _guid; WebKitCookieAcceptPolicy _httpCookieAcceptPolicy; - pid_t _webprocessPID; string _extensionPath; bool _ignoreLoadFinishedOnce; #else @@ -3715,7 +3767,7 @@ static GSourceFuncs _handlerIntervention = string url = GetPageActiveURL(page); string message(string("{ \"url\": \"") + url + string("\", \"Error code\":") + Core::NumberType(errorcode).Text() + string(" }")); - SYSLOG(Trace::Information, (_T("LoadFailed: %s"), message.c_str())); + SYSLOG(Logging::Notification, (_T("LoadFailed: %s"), message.c_str())); bool isCanceled = errorDomain && @@ -3732,7 +3784,7 @@ static GSourceFuncs _handlerIntervention = /* static */ void webProcessDidCrash(WKPageRef, const void*) { - SYSLOG(Trace::Fatal, (_T("CRASH: WebProcess crashed, exiting..."))); + SYSLOG(Logging::Fatal, (_T("CRASH: WebProcess crashed, exiting..."))); exit(1); }