WebKit Bugzilla
Attachment 371271 Details for
Bug 198526
: [GTK][WPE] Re-enable process warming
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
wk-glib-prewarm.diff (text/plain), 5.26 KB, created by
Carlos Garcia Campos
on 2019-06-04 06:05:13 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Carlos Garcia Campos
Created:
2019-06-04 06:05:13 PDT
Size:
5.26 KB
patch
obsolete
>diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 09f4b3bb1e7..2288c76b07a 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,23 @@ >+2019-06-04 Carlos Garcia Campos <cgarcia@igalia.com> >+ >+ [GTK][WPE] Re-enable process warming >+ https://bugs.webkit.org/show_bug.cgi?id=198526 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ 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. >+ > 2019-06-04 Carlos Garcia Campos <cgarcia@igalia.com> > > [GTK] Crash when re-entering AC mode after r245957 >diff --git a/Source/WebKit/UIProcess/WebProcessPool.cpp b/Source/WebKit/UIProcess/WebProcessPool.cpp >index 3e0494f5626..34bfc038b95 100644 >--- a/Source/WebKit/UIProcess/WebProcessPool.cpp >+++ b/Source/WebKit/UIProcess/WebProcessPool.cpp >@@ -820,6 +820,13 @@ RefPtr<WebProcessProxy> WebProcessPool::tryTakePrewarmedProcess(WebsiteDataStore > if (!m_prewarmedProcess) > return nullptr; > >+#if PLATFORM(GTK) || PLATFORM(WPE) >+ // In platforms using Bubblewrap for sandboxing, prewarmed process is launched using the WebProcessPool primary WebsiteDataStore, >+ // so we don't use it in case of using a different WebsiteDataStore. >+ if (m_sandboxEnabled && m_websiteDataStore && &m_websiteDataStore->websiteDataStore() != &websiteDataStore) >+ return nullptr; >+#endif >+ > ASSERT(m_prewarmedProcess->isPrewarmed()); > m_prewarmedProcess->markIsNoLongerInPrewarmedPool(); > >diff --git a/Source/WebKit/UIProcess/glib/WebProcessPoolGLib.cpp b/Source/WebKit/UIProcess/glib/WebProcessPoolGLib.cpp >index 1cb4fc1830d..992f3319a3b 100644 >--- a/Source/WebKit/UIProcess/glib/WebProcessPoolGLib.cpp >+++ b/Source/WebKit/UIProcess/glib/WebProcessPoolGLib.cpp >@@ -98,13 +98,6 @@ void WebProcessPool::platformInitialize() > > if (!memoryPressureMonitorDisabled()) > installMemoryPressureHandler(); >- >- // Process warming is incompatible with the fact our WebProcessProxy::platformGetLaunchOptions() >- // requires a valid WebsiteDataStore at initialization time for our sandbox permissions. >- // FIXME: With process warming disabled, the performance of >- // process-swap-on-navigation is not going to be great. So this needs to be >- // re-enabled when we enable PSON. >- configuration().setIsAutomaticProcessWarmingEnabled(false); > } > > void WebProcessPool::platformInitializeWebProcess(WebProcessCreationParameters& parameters) >diff --git a/Source/WebKit/UIProcess/glib/WebProcessProxyGLib.cpp b/Source/WebKit/UIProcess/glib/WebProcessProxyGLib.cpp >index 3c42baebe56..eef8826d26d 100644 >--- a/Source/WebKit/UIProcess/glib/WebProcessProxyGLib.cpp >+++ b/Source/WebKit/UIProcess/glib/WebProcessProxyGLib.cpp >@@ -38,12 +38,23 @@ void WebProcessProxy::platformGetLaunchOptions(ProcessLauncher::LaunchOptions& l > { > launchOptions.extraInitializationData.set("enable-sandbox", m_processPool->sandboxEnabled() ? "true" : "false"); > >- websiteDataStore().resolveDirectoriesIfNecessary(); >- launchOptions.extraInitializationData.set("webSQLDatabaseDirectory", websiteDataStore().resolvedDatabaseDirectory()); >- launchOptions.extraInitializationData.set("mediaKeysDirectory", websiteDataStore().resolvedMediaKeysDirectory()); >- launchOptions.extraInitializationData.set("applicationCacheDirectory", websiteDataStore().resolvedApplicationCacheDirectory()); >+ if (m_processPool->sandboxEnabled()) { >+ WebsiteDataStore* dataStore = m_websiteDataStore.get(); >+ if (!dataStore) { >+ // Prewarmed processes don't have a WebsiteDataStore yet, so use the primary WebsiteDataStore from the WebProcessPool. >+ // The process won't be used if current WebsiteDataStore is different than the WebProcessPool primary one. >+ if (auto* apiDataStore = m_processPool->websiteDataStore()) >+ dataStore = &apiDataStore->websiteDataStore(); >+ } > >- launchOptions.extraWebProcessSandboxPaths = m_processPool->sandboxPaths(); >+ ASSERT(dataStore); >+ dataStore->resolveDirectoriesIfNecessary(); >+ launchOptions.extraInitializationData.set("webSQLDatabaseDirectory", dataStore->resolvedDatabaseDirectory()); >+ launchOptions.extraInitializationData.set("mediaKeysDirectory", dataStore->resolvedMediaKeysDirectory()); >+ launchOptions.extraInitializationData.set("applicationCacheDirectory", dataStore->resolvedApplicationCacheDirectory()); >+ >+ launchOptions.extraWebProcessSandboxPaths = m_processPool->sandboxPaths(); >+ } > } > > };
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
Flags:
mcatanzaro
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 198526
: 371271