⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 246101 in webkit


Ignore:
Timestamp:
Jun 5, 2019, 12:42:09 AM (7 years ago)
Author:
Carlos Garcia Campos
Message:

[GTK][WPE] Re-enable process warming
https://bugs.webkit.org/show_bug.cgi?id=198526

Reviewed by Michael Catanzaro.

It was disabled in r243490 because bubblewrap sandbox needs a valid WebsiteDataStore before launching the web
process. We can use the default WebsiteDataStore from the WebProcessPool and only use the prewarmed process
later if the given WebsiteDataStore is the same as the WebProcessPool one.

  • UIProcess/WebProcessPool.cpp:

(WebKit::WebProcessPool::tryTakePrewarmedProcess): Do not use the prewarmed process if WebsiteDataStore is
different than the one used to launch the process when sandboxing is enabled.

  • UIProcess/glib/WebProcessPoolGLib.cpp:

(WebKit::WebProcessPool::platformInitialize): Do not disable process warming.

  • UIProcess/glib/WebProcessProxyGLib.cpp:

(WebKit::WebProcessProxy::platformGetLaunchOptions): Use the WebsiteDataStore from the WebProcessPool if process
is prewarmed and sandboxing is enabled.

Location:
trunk/Source/WebKit
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r246097 r246101  
     12019-06-05  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [GTK][WPE] Re-enable process warming
     4        https://bugs.webkit.org/show_bug.cgi?id=198526
     5
     6        Reviewed by Michael Catanzaro.
     7
     8        It was disabled in r243490 because bubblewrap sandbox needs a valid WebsiteDataStore before launching the web
     9        process. We can use the default WebsiteDataStore from the WebProcessPool and only use the prewarmed process
     10        later if the given WebsiteDataStore is the same as the WebProcessPool one.
     11
     12        * UIProcess/WebProcessPool.cpp:
     13        (WebKit::WebProcessPool::tryTakePrewarmedProcess): Do not use the prewarmed process if WebsiteDataStore is
     14        different than the one used to launch the process when sandboxing is enabled.
     15        * UIProcess/glib/WebProcessPoolGLib.cpp:
     16        (WebKit::WebProcessPool::platformInitialize): Do not disable process warming.
     17        * UIProcess/glib/WebProcessProxyGLib.cpp:
     18        (WebKit::WebProcessProxy::platformGetLaunchOptions): Use the WebsiteDataStore from the WebProcessPool if process
     19        is prewarmed and sandboxing is enabled.
     20
    1212019-06-04  Chris Dumez  <cdumez@apple.com>
    222
  • trunk/Source/WebKit/UIProcess/WebProcessPool.cpp

    r245807 r246101  
    821821        return nullptr;
    822822
     823#if PLATFORM(GTK) || PLATFORM(WPE)
     824    // In platforms using Bubblewrap for sandboxing, prewarmed process is launched using the WebProcessPool primary WebsiteDataStore,
     825    // so we don't use it in case of using a different WebsiteDataStore.
     826    if (m_sandboxEnabled && m_websiteDataStore && &m_websiteDataStore->websiteDataStore() != &websiteDataStore)
     827        return nullptr;
     828#endif
     829
    823830    ASSERT(m_prewarmedProcess->isPrewarmed());
    824831    m_prewarmedProcess->markIsNoLongerInPrewarmedPool();
  • trunk/Source/WebKit/UIProcess/glib/WebProcessPoolGLib.cpp

    r245807 r246101  
    9999    if (!memoryPressureMonitorDisabled())
    100100        installMemoryPressureHandler();
    101 
    102     // Process warming is incompatible with the fact our WebProcessProxy::platformGetLaunchOptions()
    103     // requires a valid WebsiteDataStore at initialization time for our sandbox permissions.
    104     // FIXME: With process warming disabled, the performance of
    105     // process-swap-on-navigation is not going to be great. So this needs to be
    106     // re-enabled when we enable PSON.
    107     configuration().setIsAutomaticProcessWarmingEnabled(false);
    108101}
    109102
  • trunk/Source/WebKit/UIProcess/glib/WebProcessProxyGLib.cpp

    r245807 r246101  
    3939    launchOptions.extraInitializationData.set("enable-sandbox", m_processPool->sandboxEnabled() ? "true" : "false");
    4040
    41     websiteDataStore().resolveDirectoriesIfNecessary();
    42     launchOptions.extraInitializationData.set("webSQLDatabaseDirectory", websiteDataStore().resolvedDatabaseDirectory());
    43     launchOptions.extraInitializationData.set("mediaKeysDirectory", websiteDataStore().resolvedMediaKeysDirectory());
    44     launchOptions.extraInitializationData.set("applicationCacheDirectory", websiteDataStore().resolvedApplicationCacheDirectory());
     41    if (m_processPool->sandboxEnabled()) {
     42        WebsiteDataStore* dataStore = m_websiteDataStore.get();
     43        if (!dataStore) {
     44            // Prewarmed processes don't have a WebsiteDataStore yet, so use the primary WebsiteDataStore from the WebProcessPool.
     45            // The process won't be used if current WebsiteDataStore is different than the WebProcessPool primary one.
     46            if (auto* apiDataStore = m_processPool->websiteDataStore())
     47                dataStore = &apiDataStore->websiteDataStore();
     48        }
    4549
    46     launchOptions.extraWebProcessSandboxPaths = m_processPool->sandboxPaths();
     50        ASSERT(dataStore);
     51        dataStore->resolveDirectoriesIfNecessary();
     52        launchOptions.extraInitializationData.set("webSQLDatabaseDirectory", dataStore->resolvedDatabaseDirectory());
     53        launchOptions.extraInitializationData.set("mediaKeysDirectory", dataStore->resolvedMediaKeysDirectory());
     54        launchOptions.extraInitializationData.set("applicationCacheDirectory", dataStore->resolvedApplicationCacheDirectory());
     55
     56        launchOptions.extraWebProcessSandboxPaths = m_processPool->sandboxPaths();
     57    }
    4758}
    4859
Note: See TracChangeset for help on using the changeset viewer.