Changeset 199002 in webkit


Ignore:
Timestamp:
Apr 4, 2016 3:26:28 AM (8 years ago)
Author:
commit-queue@webkit.org
Message:

Fix WEB_PROCESS_CMD_PREFIX and NETWORK_PROCESS_CMD_PREFIX after r196500
https://bugs.webkit.org/show_bug.cgi?id=156060

Patch by Emanuele Aina <Emanuele Aina> on 2016-04-04
Reviewed by Darin Adler.

Commit r196500 was a bit too eager in removing the
platformGetLaunchOptions() callsites as non-mac platform still use
that in debug builds to attach debugging tools to spawned
subprocesses (eg. gdbserver).

Instead of reinstating them and relying on each subprocess type to
implement its own platformGetLaunchOptions() version (all alike),
avoid duplication and check the *_PROCESS_CMD_PREFIX environment
variables in a single place, ChildProcessProxy::getLaunchOptions().

Doing so also improves consistency in *_PROCESS_CMD_PREFIX support:
only WEB_PROCESS_CMD_PREFIX and NETWORK_PROCESS_CMD_PREFIX worked with
both the GTK and EFL ports while PLUGIN_PROCESS_CMD_PREFIX only
worked for EFL and there was no corresponding
DATABASE_PROCESS_CMD_PREFIX implementation.

  • UIProcess/ChildProcessProxy.cpp:

(WebKit::ChildProcessProxy::getLaunchOptions): Check the
appropriate *_PROCESS_CMD_PREFIX environment variable.

  • UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:

(WebKit::PluginProcessProxy::platformGetLaunchOptions): Drop
check for PLUGIN_PROCESS_COMMAND_PREFIX, now handled by
ChildProcessProxy::getLaunchOptions().

  • UIProcess/Databases/DatabaseProcessProxy.h:
  • UIProcess/Network/NetworkProcessProxy.h:
  • UIProcess/WebProcessProxy.h: Drop platformGetLaunchOptions()

prototypes.

  • UIProcess/Network/soup/NetworkProcessProxySoup.cpp:
  • UIProcess/Databases/efl/DatabaseProcessProxyEfl.cpp:
  • UIProcess/Databases/gtk/DatabaseProcessProxyGtk.cpp:
  • UIProcess/efl/WebProcessProxyEfl.cpp:
  • UIProcess/gtk/WebProcessProxyGtk.cpp: Removed, they only contained

platformGetLaunchOptions() implementations.

  • PlatformEfl.cmake:
  • PlatformGTK.cmake: Drop removed files.
Location:
trunk/Source/WebKit2
Files:
5 deleted
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r198977 r199002  
     12016-04-04  Emanuele Aina  <emanuele.aina@collabora.com>
     2
     3        Fix WEB_PROCESS_CMD_PREFIX and NETWORK_PROCESS_CMD_PREFIX after r196500
     4        https://bugs.webkit.org/show_bug.cgi?id=156060
     5
     6        Reviewed by Darin Adler.
     7
     8        Commit r196500 was a bit too eager in removing the
     9        platformGetLaunchOptions() callsites as non-mac platform still use
     10        that in debug builds to attach debugging tools to spawned
     11        subprocesses (eg. gdbserver).
     12
     13        Instead of reinstating them and relying on each subprocess type to
     14        implement its own platformGetLaunchOptions() version (all alike),
     15        avoid duplication and check the *_PROCESS_CMD_PREFIX environment
     16        variables in a single place, ChildProcessProxy::getLaunchOptions().
     17
     18        Doing so also improves consistency in *_PROCESS_CMD_PREFIX support:
     19        only WEB_PROCESS_CMD_PREFIX and NETWORK_PROCESS_CMD_PREFIX worked with
     20        both the GTK and EFL ports while PLUGIN_PROCESS_CMD_PREFIX only
     21        worked for EFL and there was no corresponding
     22        DATABASE_PROCESS_CMD_PREFIX implementation.
     23
     24        * UIProcess/ChildProcessProxy.cpp:
     25        (WebKit::ChildProcessProxy::getLaunchOptions): Check the
     26        appropriate *_PROCESS_CMD_PREFIX environment variable.
     27        * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
     28        (WebKit::PluginProcessProxy::platformGetLaunchOptions): Drop
     29        check for PLUGIN_PROCESS_COMMAND_PREFIX, now handled by
     30        ChildProcessProxy::getLaunchOptions().
     31        * UIProcess/Databases/DatabaseProcessProxy.h:
     32        * UIProcess/Network/NetworkProcessProxy.h:
     33        * UIProcess/WebProcessProxy.h: Drop platformGetLaunchOptions()
     34        prototypes.
     35        * UIProcess/Network/soup/NetworkProcessProxySoup.cpp:
     36        * UIProcess/Databases/efl/DatabaseProcessProxyEfl.cpp:
     37        * UIProcess/Databases/gtk/DatabaseProcessProxyGtk.cpp:
     38        * UIProcess/efl/WebProcessProxyEfl.cpp:
     39        * UIProcess/gtk/WebProcessProxyGtk.cpp: Removed, they only contained
     40        platformGetLaunchOptions() implementations.
     41        * PlatformEfl.cmake:
     42        * PlatformGTK.cmake: Drop removed files.
     43
    1442016-04-02  Daniel Bates  <dabates@apple.com>
    245
  • trunk/Source/WebKit2/PlatformEfl.cmake

    r197592 r199002  
    127127    UIProcess/CoordinatedGraphics/WebPageProxyCoordinatedGraphics.cpp
    128128
    129     UIProcess/Databases/efl/DatabaseProcessProxyEfl.cpp
    130 
    131129    UIProcess/InspectorServer/efl/WebInspectorServerEfl.cpp
    132130
     
    138136    UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManager.cpp
    139137    UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManagerClient.cpp
    140 
    141     UIProcess/Network/soup/NetworkProcessProxySoup.cpp
    142138
    143139    UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp
     
    179175    UIProcess/efl/WebPreferencesEfl.cpp
    180176    UIProcess/efl/WebProcessPoolEfl.cpp
    181     UIProcess/efl/WebProcessProxyEfl.cpp
    182177    UIProcess/efl/WebView.cpp
    183178    UIProcess/efl/WebViewClient.cpp
  • trunk/Source/WebKit2/PlatformGTK.cmake

    r198058 r199002  
    278278    UIProcess/API/gtk/webkit2.h
    279279
    280     UIProcess/Databases/gtk/DatabaseProcessProxyGtk.cpp
    281 
    282280    UIProcess/InspectorServer/gtk/WebInspectorServerGtk.cpp
    283281
     
    289287    UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManager.cpp
    290288    UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManagerClient.cpp
    291 
    292     UIProcess/Network/soup/NetworkProcessProxySoup.cpp
    293289
    294290    UIProcess/Plugins/gtk/PluginInfoCache.cpp
     
    322318    UIProcess/gtk/WebPreferencesGtk.cpp
    323319    UIProcess/gtk/WebProcessPoolGtk.cpp
    324     UIProcess/gtk/WebProcessProxyGtk.cpp
    325320
    326321    UIProcess/soup/WebCookieManagerProxySoup.cpp
  • trunk/Source/WebKit2/UIProcess/ChildProcessProxy.cpp

    r194895 r199002  
    6161    if (const char* userDirectorySuffix = getenv("DIRHELPER_USER_DIR_SUFFIX"))
    6262        launchOptions.extraInitializationData.add(ASCIILiteral("user-directory-suffix"), userDirectorySuffix);
     63
     64#if !defined(NDEBUG) && (PLATFORM(GTK) || PLATFORM(EFL))
     65    const char* varname;
     66    switch (launchOptions.processType) {
     67    case ProcessLauncher::ProcessType::Web:
     68        varname = "WEB_PROCESS_CMD_PREFIX";
     69        break;
     70#if ENABLE(NETSCAPE_PLUGIN_API)
     71    case ProcessLauncher::ProcessType::Plugin64:
     72    case ProcessLauncher::ProcessType::Plugin32:
     73        varname = "PLUGIN_PROCESS_CMD_PREFIX";
     74        break;
     75#endif
     76    case ProcessLauncher::ProcessType::Network:
     77        varname = "NETWORK_PROCESS_CMD_PREFIX";
     78        break;
     79#if ENABLE(DATABASE_PROCESS)
     80    case ProcessLauncher::ProcessType::Database:
     81        varname = "DATABASE_PROCESS_CMD_PREFIX";
     82        break;
     83#endif
     84    }
     85    const char* processCmdPrefix = getenv(varname);
     86    if (processCmdPrefix && *processCmdPrefix)
     87        launchOptions.processCmdPrefix = String::fromUTF8(processCmdPrefix);
     88#endif // !defined(NDEBUG) && (PLATFORM(GTK) || PLATFORM(EFL)
    6389}
    6490
  • trunk/Source/WebKit2/UIProcess/Databases/DatabaseProcessProxy.h

    r197563 r199002  
    8181    void didFinishLaunching(ProcessLauncher*, IPC::Connection::Identifier) override;
    8282
    83     void platformGetLaunchOptions(ProcessLauncher::LaunchOptions&);
    84 
    8583    WebProcessPool* m_processPool;
    8684
  • trunk/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.h

    r197563 r199002  
    8383    void processWillShutDown(IPC::Connection&) override;
    8484
    85     void platformGetLaunchOptions(ProcessLauncher::LaunchOptions&);
    8685    void networkProcessCrashedOrFailedToLaunch();
    8786
  • trunk/Source/WebKit2/UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp

    r196548 r199002  
    5454{
    5555    launchOptions.processType = ProcessLauncher::ProcessType::Plugin64;
    56 
    57 #if PLATFORM(EFL) && !defined(NDEBUG)
    58     const char* commandPrefix = getenv("PLUGIN_PROCESS_COMMAND_PREFIX");
    59     if (commandPrefix && *commandPrefix)
    60         launchOptions.processCmdPrefix = String::fromUTF8(commandPrefix);
    61 #endif
    6256
    6357    launchOptions.extraInitializationData.add("plugin-path", pluginProcessAttributes.moduleInfo.path);
  • trunk/Source/WebKit2/UIProcess/WebProcessProxy.h

    r197563 r199002  
    159159    // From ChildProcessProxy
    160160    void getLaunchOptions(ProcessLauncher::LaunchOptions&) override;
    161     void platformGetLaunchOptions(ProcessLauncher::LaunchOptions&);
    162161    void connectionWillOpen(IPC::Connection&) override;
    163162    void processWillShutDown(IPC::Connection&) override;
Note: See TracChangeset for help on using the changeset viewer.