WebKit Bugzilla
Attachment 361666 Details for
Bug 194494
: [WPE] Send client host fd and library name as web process creation parameters
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
wpe-client-host-fd.diff (text/plain), 8.38 KB, created by
Carlos Garcia Campos
on 2019-02-11 00:37:29 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Carlos Garcia Campos
Created:
2019-02-11 00:37:29 PST
Size:
8.38 KB
patch
obsolete
>diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 9c42a56dff6..41b1e9d6e9e 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,25 @@ >+2019-02-11 Carlos Garcia Campos <cgarcia@igalia.com> >+ >+ [WPE] Send client host fd and library name as web process creation parameters >+ https://bugs.webkit.org/show_bug.cgi?id=194494 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Instead of using command line arguments. The code is simpler and we don't need wpe specific code in process >+ launcher glib implementation. >+ >+ * Shared/WebProcessCreationParameters.cpp: >+ (WebKit::WebProcessCreationParameters::encode const): >+ (WebKit::WebProcessCreationParameters::decode): >+ * Shared/WebProcessCreationParameters.h: >+ * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp: >+ (WebKit::ProcessLauncher::launchProcess): >+ * UIProcess/wpe/WebProcessPoolWPE.cpp: >+ (WebKit::WebProcessPool::platformInitializeWebProcess): >+ * WebProcess/glib/WebProcessGLib.cpp: >+ (WebKit::WebProcess::platformInitializeWebProcess): >+ * WebProcess/wpe/WebProcessMainWPE.cpp: >+ > 2019-02-10 Carlos Garcia Campos <cgarcia@igalia.com> > > [WPE] Do not use a sync IPC message to send the host FD to the web process >diff --git a/Source/WebKit/Shared/WebProcessCreationParameters.cpp b/Source/WebKit/Shared/WebProcessCreationParameters.cpp >index 29f9933ed8a..3ecb1f14454 100644 >--- a/Source/WebKit/Shared/WebProcessCreationParameters.cpp >+++ b/Source/WebKit/Shared/WebProcessCreationParameters.cpp >@@ -159,6 +159,11 @@ void WebProcessCreationParameters::encode(IPC::Encoder& encoder) const > encoder << screenProperties; > encoder << useOverlayScrollbars; > #endif >+ >+#if PLATFORM(WPE) >+ encoder << hostClientFileDescriptor; >+ encoder << implementationLibraryName; >+#endif > } > > bool WebProcessCreationParameters::decode(IPC::Decoder& decoder, WebProcessCreationParameters& parameters) >@@ -421,6 +426,13 @@ bool WebProcessCreationParameters::decode(IPC::Decoder& decoder, WebProcessCreat > return false; > #endif > >+#if PLATFORM(WPE) >+ if (!decoder.decode(parameters.hostClientFileDescriptor)) >+ return false; >+ if (!decoder.decode(parameters.implementationLibraryName)) >+ return false; >+#endif >+ > return true; > } > >diff --git a/Source/WebKit/Shared/WebProcessCreationParameters.h b/Source/WebKit/Shared/WebProcessCreationParameters.h >index b7821aa5cfb..86f55e1ca33 100644 >--- a/Source/WebKit/Shared/WebProcessCreationParameters.h >+++ b/Source/WebKit/Shared/WebProcessCreationParameters.h >@@ -198,6 +198,11 @@ struct WebProcessCreationParameters { > WebCore::ScreenProperties screenProperties; > bool useOverlayScrollbars { true }; > #endif >+ >+#if PLATFORM(WPE) >+ IPC::Attachment hostClientFileDescriptor; >+ CString implementationLibraryName; >+#endif > }; > > } // namespace WebKit >diff --git a/Source/WebKit/UIProcess/Launcher/glib/ProcessLauncherGLib.cpp b/Source/WebKit/UIProcess/Launcher/glib/ProcessLauncherGLib.cpp >index 0c39073fe1d..34028e68035 100644 >--- a/Source/WebKit/UIProcess/Launcher/glib/ProcessLauncherGLib.cpp >+++ b/Source/WebKit/UIProcess/Launcher/glib/ProcessLauncherGLib.cpp >@@ -42,10 +42,6 @@ > #include <wtf/text/CString.h> > #include <wtf/text/WTFString.h> > >-#if PLATFORM(WPE) >-#include <wpe/wpe.h> >-#endif >- > namespace WebKit { > > static void childSetupFunction(gpointer userData) >@@ -112,20 +108,6 @@ void ProcessLauncher::launchProcess() > GUniquePtr<gchar> webkitSocket(g_strdup_printf("%d", socketPair.client)); > unsigned nargs = 5; // size of the argv array for g_spawn_async() > >-#if PLATFORM(WPE) >- GUniquePtr<gchar> wpeSocket; >- CString wpeBackendLibraryParameter; >- if (m_launchOptions.processType == ProcessLauncher::ProcessType::Web) { >-#if defined(WPE_BACKEND_CHECK_VERSION) && WPE_BACKEND_CHECK_VERSION(0, 2, 0) >- wpeBackendLibraryParameter = FileSystem::fileSystemRepresentation(wpe_loader_get_loaded_implementation_library_name()); >-#endif >- nargs++; >- >- wpeSocket = GUniquePtr<gchar>(g_strdup_printf("%d", wpe_renderer_host_create_client())); >- nargs++; >- } >-#endif >- > #if ENABLE(DEVELOPER_MODE) > Vector<CString> prefixArgs; > if (!m_launchOptions.processCmdPrefix.isNull()) { >@@ -145,12 +127,6 @@ void ProcessLauncher::launchProcess() > argv[i++] = const_cast<char*>(realExecutablePath.data()); > argv[i++] = processIdentifier.get(); > argv[i++] = webkitSocket.get(); >-#if PLATFORM(WPE) >- if (m_launchOptions.processType == ProcessLauncher::ProcessType::Web) { >- argv[i++] = const_cast<char*>(wpeBackendLibraryParameter.isNull() ? "-" : wpeBackendLibraryParameter.data()); >- argv[i++] = wpeSocket.get(); >- } >-#endif > #if ENABLE(NETSCAPE_PLUGIN_API) > argv[i++] = const_cast<char*>(realPluginPath.data()); > #else >diff --git a/Source/WebKit/UIProcess/wpe/WebProcessPoolWPE.cpp b/Source/WebKit/UIProcess/wpe/WebProcessPoolWPE.cpp >index f51017a8ca2..995ec6d5910 100644 >--- a/Source/WebKit/UIProcess/wpe/WebProcessPoolWPE.cpp >+++ b/Source/WebKit/UIProcess/wpe/WebProcessPoolWPE.cpp >@@ -37,6 +37,7 @@ > #include <WebCore/NotImplemented.h> > #include <WebCore/SchemeRegistry.h> > #include <cstdlib> >+#include <wpe/wpe.h> > #include <wtf/FileSystem.h> > > #if ENABLE(REMOTE_INSPECTOR) >@@ -86,6 +87,11 @@ void WebProcessPool::platformInitialize() > > void WebProcessPool::platformInitializeWebProcess(WebProcessCreationParameters& parameters) > { >+ parameters.hostClientFileDescriptor = wpe_renderer_host_create_client(); >+#if defined(WPE_BACKEND_CHECK_VERSION) && WPE_BACKEND_CHECK_VERSION(0, 2, 0) >+ parameters.implementationLibraryName = FileSystem::fileSystemRepresentation(wpe_loader_get_loaded_implementation_library_name()); >+#endif >+ > parameters.memoryCacheDisabled = m_memoryCacheDisabled || cacheModel() == CacheModel::DocumentViewer; > > const char* disableMemoryPressureMonitor = getenv("WEBKIT_DISABLE_MEMORY_PRESSURE_MONITOR"); >diff --git a/Source/WebKit/WebProcess/glib/WebProcessGLib.cpp b/Source/WebKit/WebProcess/glib/WebProcessGLib.cpp >index 17da52de5ed..85b073689b5 100644 >--- a/Source/WebKit/WebProcess/glib/WebProcessGLib.cpp >+++ b/Source/WebKit/WebProcess/glib/WebProcessGLib.cpp >@@ -35,6 +35,11 @@ > #include "WaylandCompositorDisplay.h" > #endif > >+#if PLATFORM(WPE) >+#include <WebCore/PlatformDisplayLibWPE.h> >+#include <wpe/wpe.h> >+#endif >+ > namespace WebKit { > > void WebProcess::platformSetCacheModel(CacheModel cacheModel) >@@ -44,6 +49,12 @@ void WebProcess::platformSetCacheModel(CacheModel cacheModel) > > void WebProcess::platformInitializeWebProcess(WebProcessCreationParameters&& parameters) > { >+#if PLATFORM(WPE) >+ if (!parameters.implementationLibraryName.isNull()) >+ 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); > #endif >diff --git a/Source/WebKit/WebProcess/wpe/WebProcessMainWPE.cpp b/Source/WebKit/WebProcess/wpe/WebProcessMainWPE.cpp >index 13192b44d43..fd8c6ab2026 100644 >--- a/Source/WebKit/WebProcess/wpe/WebProcessMainWPE.cpp >+++ b/Source/WebKit/WebProcess/wpe/WebProcessMainWPE.cpp >@@ -29,11 +29,7 @@ > > #include "AuxiliaryProcessMain.h" > #include "WebProcess.h" >-#include <WebCore/PlatformDisplayLibWPE.h> > #include <glib.h> >-#include <iostream> >-#include <libsoup/soup.h> >-#include <wpe/wpe.h> > > namespace WebKit { > using namespace WebCore; >@@ -53,28 +49,6 @@ public: > > return true; > } >- >- bool parseCommandLine(int argc, char** argv) override >- { >- ASSERT(argc == 5); >- if (argc < 5) >- return false; >- >- if (!AuxiliaryProcessMainBase::parseCommandLine(argc, argv)) >- return false; >- >-#if defined(WPE_BACKEND_CHECK_VERSION) && WPE_BACKEND_CHECK_VERSION(0, 2, 0) >- wpe_loader_init(argv[3]); >-#endif >- >- int wpeFd = atoi(argv[4]); >- RunLoop::main().dispatch( >- [wpeFd] { >- RELEASE_ASSERT(is<PlatformDisplayLibWPE>(PlatformDisplay::sharedDisplay())); >- downcast<PlatformDisplayLibWPE>(PlatformDisplay::sharedDisplay()).initialize(wpeFd); >- }); >- return true; >- } > }; > > int WebProcessMainUnix(int argc, char** argv)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 194494
:
361666
|
361677
|
362489