Title: [242437] trunk/Source/WebKit
- Revision
- 242437
- Author
- commit-qu...@webkit.org
- Date
- 2019-03-05 03:59:27 -0800 (Tue, 05 Mar 2019)
Log Message
[WPE] Do not create a PlatformDisplay in the Service Worker process
https://bugs.webkit.org/show_bug.cgi?id=194830
Patch by Loïc Yhuel <loic.yh...@softathome.com> on 2019-03-05
Reviewed by Žan Doberšek.
It avoids opening the Wayland socket in this WPEWebProcess, which might cause issues
depending on the platform, and allocates unneeded resources.
* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode const):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h: Add new isServiceWorkerProcess parameter.
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::initializeNewWebProcess): Set isServiceWorkerProcess parameter.
* UIProcess/glib/WebProcessPoolGLib.cpp:
(WebKit::WebProcessPool::platformInitializeWebProcess): No implementationLibraryName and hostClientFileDescriptor for Service Worker.
* WebProcess/glib/WebProcessGLib.cpp:
(WebKit::WebProcess::platformInitializeWebProcess): No wpe_loader_init nor PlatformDisplayLibWPE for Service Worker.
Modified Paths
Diff
Modified: trunk/Source/WebKit/ChangeLog (242436 => 242437)
--- trunk/Source/WebKit/ChangeLog 2019-03-05 10:35:43 UTC (rev 242436)
+++ trunk/Source/WebKit/ChangeLog 2019-03-05 11:59:27 UTC (rev 242437)
@@ -1,3 +1,24 @@
+2019-03-05 Loïc Yhuel <loic.yh...@softathome.com>
+
+ [WPE] Do not create a PlatformDisplay in the Service Worker process
+ https://bugs.webkit.org/show_bug.cgi?id=194830
+
+ Reviewed by Žan Doberšek.
+
+ It avoids opening the Wayland socket in this WPEWebProcess, which might cause issues
+ depending on the platform, and allocates unneeded resources.
+
+ * Shared/WebProcessCreationParameters.cpp:
+ (WebKit::WebProcessCreationParameters::encode const):
+ (WebKit::WebProcessCreationParameters::decode):
+ * Shared/WebProcessCreationParameters.h: Add new isServiceWorkerProcess parameter.
+ * UIProcess/WebProcessPool.cpp:
+ (WebKit::WebProcessPool::initializeNewWebProcess): Set isServiceWorkerProcess parameter.
+ * UIProcess/glib/WebProcessPoolGLib.cpp:
+ (WebKit::WebProcessPool::platformInitializeWebProcess): No implementationLibraryName and hostClientFileDescriptor for Service Worker.
+ * WebProcess/glib/WebProcessGLib.cpp:
+ (WebKit::WebProcess::platformInitializeWebProcess): No wpe_loader_init nor PlatformDisplayLibWPE for Service Worker.
+
2019-03-04 Brady Eidson <beid...@apple.com>
Unreviewed, rolling out r242376.
Modified: trunk/Source/WebKit/Shared/WebProcessCreationParameters.cpp (242436 => 242437)
--- trunk/Source/WebKit/Shared/WebProcessCreationParameters.cpp 2019-03-05 10:35:43 UTC (rev 242436)
+++ trunk/Source/WebKit/Shared/WebProcessCreationParameters.cpp 2019-03-05 11:59:27 UTC (rev 242437)
@@ -161,6 +161,7 @@
#endif
#if PLATFORM(WPE)
+ encoder << isServiceWorkerProcess;
encoder << hostClientFileDescriptor;
encoder << implementationLibraryName;
#endif
@@ -427,6 +428,8 @@
#endif
#if PLATFORM(WPE)
+ if (!decoder.decode(parameters.isServiceWorkerProcess))
+ return false;
if (!decoder.decode(parameters.hostClientFileDescriptor))
return false;
if (!decoder.decode(parameters.implementationLibraryName))
Modified: trunk/Source/WebKit/Shared/WebProcessCreationParameters.h (242436 => 242437)
--- trunk/Source/WebKit/Shared/WebProcessCreationParameters.h 2019-03-05 10:35:43 UTC (rev 242436)
+++ trunk/Source/WebKit/Shared/WebProcessCreationParameters.h 2019-03-05 11:59:27 UTC (rev 242437)
@@ -200,6 +200,7 @@
#endif
#if PLATFORM(WPE)
+ bool isServiceWorkerProcess { false };
IPC::Attachment hostClientFileDescriptor;
CString implementationLibraryName;
#endif
Modified: trunk/Source/WebKit/UIProcess/WebProcessPool.cpp (242436 => 242437)
--- trunk/Source/WebKit/UIProcess/WebProcessPool.cpp 2019-03-05 10:35:43 UTC (rev 242436)
+++ trunk/Source/WebKit/UIProcess/WebProcessPool.cpp 2019-03-05 11:59:27 UTC (rev 242437)
@@ -949,6 +949,10 @@
parameters.mediaMIMETypes = process.mediaMIMETypes();
#endif
+#if PLATFORM(WPE)
+ parameters.isServiceWorkerProcess = process.isServiceWorkerProcess();
+#endif
+
// Add any platform specific parameters
platformInitializeWebProcess(parameters);
Modified: trunk/Source/WebKit/UIProcess/glib/WebProcessPoolGLib.cpp (242436 => 242437)
--- trunk/Source/WebKit/UIProcess/glib/WebProcessPoolGLib.cpp 2019-03-05 10:35:43 UTC (rev 242436)
+++ trunk/Source/WebKit/UIProcess/glib/WebProcessPoolGLib.cpp 2019-03-05 11:59:27 UTC (rev 242437)
@@ -95,8 +95,10 @@
void WebProcessPool::platformInitializeWebProcess(WebProcessCreationParameters& parameters)
{
#if PLATFORM(WPE)
- parameters.hostClientFileDescriptor = wpe_renderer_host_create_client();
- parameters.implementationLibraryName = FileSystem::fileSystemRepresentation(wpe_loader_get_loaded_implementation_library_name());
+ if (!parameters.isServiceWorkerProcess) {
+ parameters.hostClientFileDescriptor = wpe_renderer_host_create_client();
+ parameters.implementationLibraryName = FileSystem::fileSystemRepresentation(wpe_loader_get_loaded_implementation_library_name());
+ }
#endif
parameters.memoryCacheDisabled = m_memoryCacheDisabled || cacheModel() == CacheModel::DocumentViewer;
Modified: trunk/Source/WebKit/WebProcess/glib/WebProcessGLib.cpp (242436 => 242437)
--- trunk/Source/WebKit/WebProcess/glib/WebProcessGLib.cpp 2019-03-05 10:35:43 UTC (rev 242436)
+++ trunk/Source/WebKit/WebProcess/glib/WebProcessGLib.cpp 2019-03-05 11:59:27 UTC (rev 242437)
@@ -50,11 +50,14 @@
void WebProcess::platformInitializeWebProcess(WebProcessCreationParameters&& parameters)
{
#if PLATFORM(WPE)
- auto& implementationLibraryName = parameters.implementationLibraryName;
- if (!implementationLibraryName.isNull() && implementationLibraryName.data()[0] != '\0')
- wpe_loader_init(parameters.implementationLibraryName.data());
- RELEASE_ASSERT(is<PlatformDisplayLibWPE>(PlatformDisplay::sharedDisplay()));
- downcast<PlatformDisplayLibWPE>(PlatformDisplay::sharedDisplay()).initialize(parameters.hostClientFileDescriptor.releaseFileDescriptor());
+ if (!parameters.isServiceWorkerProcess) {
+ auto& implementationLibraryName = parameters.implementationLibraryName;
+ if (!implementationLibraryName.isNull() && implementationLibraryName.data()[0] != '\0')
+ wpe_loader_init(parameters.implementationLibraryName.data());
+
+ RELEASE_ASSERT(is<PlatformDisplayLibWPE>(PlatformDisplay::sharedDisplay()));
+ downcast<PlatformDisplayLibWPE>(PlatformDisplay::sharedDisplay()).initialize(parameters.hostClientFileDescriptor.releaseFileDescriptor());
+ }
#endif
#if PLATFORM(WAYLAND)
m_waylandCompositorDisplay = WaylandCompositorDisplay::create(parameters.waylandCompositorDisplayName);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes