Title: [233763] trunk
Revision
233763
Author
[email protected]
Date
2018-07-11 22:56:15 -0700 (Wed, 11 Jul 2018)

Log Message

[WPE] Pass the backend library name as command line parameter to the web process
https://bugs.webkit.org/show_bug.cgi?id=186841

Reviewed by Žan Doberšek.

Source/WebKit:

* UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
(WebKit::ProcessLauncher::launchProcess): Add --backend-library parameter when launching the web process.
* WebProcess/wpe/WebProcessMainWPE.cpp: Call wpe_loader_init() with the library passed as --backend-library parameter.

Tools:

* MiniBrowser/wpe/main.cpp:
(main): Stop using WPE_BACKEND_LIBRARY env var.
* Scripts/run-wpe-tests:
(WPETestRunner.__init__): Ditto.
* Scripts/webkitpy/port/wpe.py:
(WPEPort.setup_environ_for_server): Ditto.
* wpe/backends/ViewBackend.cpp:
(WPEToolingBackends::ViewBackend::ViewBackend): Call wpe_loader_init() to ensure WPEBackend-fdo is used.
* wpe/jhbuild.modules: Upgrade WPEBackend to version 0.2.0.

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (233762 => 233763)


--- trunk/Source/WebKit/ChangeLog	2018-07-12 05:40:20 UTC (rev 233762)
+++ trunk/Source/WebKit/ChangeLog	2018-07-12 05:56:15 UTC (rev 233763)
@@ -1,3 +1,14 @@
+2018-07-11  Carlos Garcia Campos  <[email protected]>
+
+        [WPE] Pass the backend library name as command line parameter to the web process
+        https://bugs.webkit.org/show_bug.cgi?id=186841
+
+        Reviewed by Žan Doberšek.
+
+        * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
+        (WebKit::ProcessLauncher::launchProcess): Add --backend-library parameter when launching the web process.
+        * WebProcess/wpe/WebProcessMainWPE.cpp: Call wpe_loader_init() with the library passed as --backend-library parameter.
+
 2018-07-11  Jon Lee  <[email protected]>
 
         Update iOS fullscreen alert text

Modified: trunk/Source/WebKit/UIProcess/Launcher/glib/ProcessLauncherGLib.cpp (233762 => 233763)


--- trunk/Source/WebKit/UIProcess/Launcher/glib/ProcessLauncherGLib.cpp	2018-07-12 05:40:20 UTC (rev 233762)
+++ trunk/Source/WebKit/UIProcess/Launcher/glib/ProcessLauncherGLib.cpp	2018-07-12 05:56:15 UTC (rev 233763)
@@ -99,7 +99,13 @@
 
 #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++;
     }
@@ -127,8 +133,10 @@
     argv[i++] = processIdentifier.get();
     argv[i++] = webkitSocket.get();
 #if PLATFORM(WPE)
-    if (m_launchOptions.processType == ProcessLauncher::ProcessType::Web)
+    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());

Modified: trunk/Source/WebKit/WebProcess/wpe/WebProcessMainWPE.cpp (233762 => 233763)


--- trunk/Source/WebKit/WebProcess/wpe/WebProcessMainWPE.cpp	2018-07-12 05:40:20 UTC (rev 233762)
+++ trunk/Source/WebKit/WebProcess/wpe/WebProcessMainWPE.cpp	2018-07-12 05:56:15 UTC (rev 233763)
@@ -33,6 +33,7 @@
 #include <glib.h>
 #include <iostream>
 #include <libsoup/soup.h>
+#include <wpe/wpe.h>
 
 using namespace WebCore;
 
@@ -56,14 +57,18 @@
 
     bool parseCommandLine(int argc, char** argv) override
     {
-        ASSERT(argc == 4);
-        if (argc < 4)
+        ASSERT(argc == 5);
+        if (argc < 5)
             return false;
 
         if (!ChildProcessMainBase::parseCommandLine(argc, argv))
             return false;
 
-        int wpeFd = atoi(argv[3]);
+#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<PlatformDisplayWPE>(PlatformDisplay::sharedDisplay()));

Modified: trunk/Tools/ChangeLog (233762 => 233763)


--- trunk/Tools/ChangeLog	2018-07-12 05:40:20 UTC (rev 233762)
+++ trunk/Tools/ChangeLog	2018-07-12 05:56:15 UTC (rev 233763)
@@ -1,5 +1,22 @@
 2018-07-11  Carlos Garcia Campos  <[email protected]>
 
+        [WPE] Pass the backend library name as command line parameter to the web process
+        https://bugs.webkit.org/show_bug.cgi?id=186841
+
+        Reviewed by Žan Doberšek.
+
+        * MiniBrowser/wpe/main.cpp:
+        (main): Stop using WPE_BACKEND_LIBRARY env var.
+        * Scripts/run-wpe-tests:
+        (WPETestRunner.__init__): Ditto.
+        * Scripts/webkitpy/port/wpe.py:
+        (WPEPort.setup_environ_for_server): Ditto.
+        * wpe/backends/ViewBackend.cpp:
+        (WPEToolingBackends::ViewBackend::ViewBackend): Call wpe_loader_init() to ensure WPEBackend-fdo is used.
+        * wpe/jhbuild.modules: Upgrade WPEBackend to version 0.2.0.
+
+2018-07-11  Carlos Garcia Campos  <[email protected]>
+
         [GLIB] Add API to allow creating variadic functions
         https://bugs.webkit.org/show_bug.cgi?id=187517
 

Modified: trunk/Tools/MiniBrowser/wpe/main.cpp (233762 => 233763)


--- trunk/Tools/MiniBrowser/wpe/main.cpp	2018-07-12 05:40:20 UTC (rev 233762)
+++ trunk/Tools/MiniBrowser/wpe/main.cpp	2018-07-12 05:56:15 UTC (rev 233763)
@@ -101,9 +101,6 @@
 
 int main(int argc, char *argv[])
 {
-    // MiniBrowser only works with WPEBackend-fdo, so ensure no other backend is used,
-    // either by passing the WPE_BACKEND_LIBRARY env var or loading the default symlink.
-    g_setenv("WPE_BACKEND_LIBRARY", "libWPEBackend-fdo-0.1.so", TRUE);
 #if ENABLE_DEVELOPER_MODE
     g_setenv("WEBKIT_INJECTED_BUNDLE_PATH", WEBKIT_INJECTED_BUNDLE_PATH, FALSE);
 #endif

Modified: trunk/Tools/Scripts/run-wpe-tests (233762 => 233763)


--- trunk/Tools/Scripts/run-wpe-tests	2018-07-12 05:40:20 UTC (rev 233762)
+++ trunk/Tools/Scripts/run-wpe-tests	2018-07-12 05:56:15 UTC (rev 233763)
@@ -36,10 +36,6 @@
     def __init__(self, options, tests=[]):
         super(WPETestRunner, self).__init__("wpe", options, tests)
 
-    def _setup_testing_environment(self):
-        super(WPETestRunner, self)._setup_testing_environment()
-        self._test_env["WPE_BACKEND_LIBRARY"] = "libWPEBackend-fdo-0.1.so"
-
     def is_glib_test(self, test_program):
         return os.path.basename(os.path.dirname(test_program)) in ["WPE", "_javascript_Core"]
 

Modified: trunk/Tools/Scripts/webkitpy/port/wpe.py (233762 => 233763)


--- trunk/Tools/Scripts/webkitpy/port/wpe.py	2018-07-12 05:40:20 UTC (rev 233762)
+++ trunk/Tools/Scripts/webkitpy/port/wpe.py	2018-07-12 05:56:15 UTC (rev 233763)
@@ -70,7 +70,6 @@
 
     def setup_environ_for_server(self, server_name=None):
         environment = super(WPEPort, self).setup_environ_for_server(server_name)
-        environment['WPE_BACKEND_LIBRARY'] = 'libWPEBackend-fdo-0.1.so'
         environment['G_DEBUG'] = 'fatal-criticals'
         environment['GSETTINGS_BACKEND'] = 'memory'
         environment['TEST_RUNNER_INJECTED_BUNDLE_FILENAME'] = self._build_path('lib', 'libTestRunnerInjectedBundle.so')

Modified: trunk/Tools/wpe/backends/ViewBackend.cpp (233762 => 233763)


--- trunk/Tools/wpe/backends/ViewBackend.cpp	2018-07-12 05:40:20 UTC (rev 233762)
+++ trunk/Tools/wpe/backends/ViewBackend.cpp	2018-07-12 05:56:15 UTC (rev 233763)
@@ -35,6 +35,9 @@
     : m_width(width)
     , m_height(height)
 {
+#if defined(WPE_BACKEND_CHECK_VERSION) && WPE_BACKEND_CHECK_VERSION(0, 2, 0)
+    wpe_loader_init("libWPEBackend-fdo-0.1.so");
+#endif
 }
 
 ViewBackend::~ViewBackend()

Modified: trunk/Tools/wpe/jhbuild.modules (233762 => 233763)


--- trunk/Tools/wpe/jhbuild.modules	2018-07-12 05:40:20 UTC (rev 233762)
+++ trunk/Tools/wpe/jhbuild.modules	2018-07-12 05:56:15 UTC (rev 233763)
@@ -167,7 +167,7 @@
 
   <cmake id="wpebackend">
     <branch repo="github.com" module="WebPlatformForEmbedded/WPEBackend.git"
-            tag="761496dff51b6962200294b4fe2bc9529da731a8" />
+            tag="411decf4875e7a5c858489206cdb7705a4bbb581" />
   </cmake>
 
   <cmake id="wpebackend-fdo">
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to