Diff
Modified: trunk/Source/WebKit/ChangeLog (244509 => 244510)
--- trunk/Source/WebKit/ChangeLog 2019-04-22 19:57:58 UTC (rev 244509)
+++ trunk/Source/WebKit/ChangeLog 2019-04-22 21:08:07 UTC (rev 244510)
@@ -1,3 +1,15 @@
+2019-04-22 Chris Dumez <cdu...@apple.com>
+
+ Unreviewed, rolling out r244502.
+
+ Caused crashes on the bots
+
+ Reverted changeset:
+
+ "Delayed WebProcessLaunch may break the _relatedWebView SPI"
+ https://bugs.webkit.org/show_bug.cgi?id=197160
+ https://trac.webkit.org/changeset/244502
+
2019-04-22 Ryan Haddad <ryanhad...@apple.com>
Unreviewed, rolling out r244437.
Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.cpp (244509 => 244510)
--- trunk/Source/WebKit/UIProcess/WebPageProxy.cpp 2019-04-22 19:57:58 UTC (rev 244509)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.cpp 2019-04-22 21:08:07 UTC (rev 244510)
@@ -727,11 +727,7 @@
m_process->removeMessageReceiver(Messages::WebPageProxy::messageReceiverName(), m_pageID);
auto& processPool = m_process->processPool();
-
- if (auto* relatedPage = m_configuration->relatedPage())
- m_process = relatedPage->ensureRunningProcess();
- else
- m_process = processPool.processForRegistrableDomain(m_websiteDataStore.get(), this, registrableDomain);
+ m_process = processPool.processForRegistrableDomain(m_websiteDataStore.get(), this, registrableDomain);
m_hasRunningProcess = true;
m_process->addExistingWebPage(*this, WebProcessProxy::BeginsUsingDataStore::Yes);
@@ -1076,14 +1072,6 @@
}
#endif
-WebProcessProxy& WebPageProxy::ensureRunningProcess()
-{
- if (!hasRunningProcess())
- launchProcess({ });
-
- return m_process;
-}
-
RefPtr<API::Navigation> WebPageProxy::loadRequest(ResourceRequest&& request, ShouldOpenExternalURLsPolicy shouldOpenExternalURLsPolicy, API::Object* userData)
{
if (m_isClosed)
Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.h (244509 => 244510)
--- trunk/Source/WebKit/UIProcess/WebPageProxy.h 2019-04-22 19:57:58 UTC (rev 244509)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.h 2019-04-22 21:08:07 UTC (rev 244510)
@@ -1083,7 +1083,6 @@
bool isValidKeypressCommandName(const String& name) const { return m_knownKeypressCommandNames.contains(name); }
#endif
- WebProcessProxy& ensureRunningProcess();
WebProcessProxy& process() { return m_process; }
ProcessID processIdentifier() const;
Modified: trunk/Source/WebKit/UIProcess/WebProcessPool.cpp (244509 => 244510)
--- trunk/Source/WebKit/UIProcess/WebProcessPool.cpp 2019-04-22 19:57:58 UTC (rev 244509)
+++ trunk/Source/WebKit/UIProcess/WebProcessPool.cpp 2019-04-22 21:08:07 UTC (rev 244510)
@@ -1210,18 +1210,13 @@
}
RefPtr<WebProcessProxy> process;
-
- if (m_isDelayedWebProcessLaunchDisabled) {
- if (pageConfiguration->relatedPage()) {
- // Sharing processes, e.g. when creating the page via window.open().
- // Make sure the related page's process is not the dummy one.
- process = &pageConfiguration->relatedPage()->ensureRunningProcess();
- // We do not support several WebsiteDataStores sharing a single process.
- ASSERT(process.get() == m_dummyProcessProxy || &pageConfiguration->websiteDataStore()->websiteDataStore() == &process->websiteDataStore());
- ASSERT(&pageConfiguration->relatedPage()->websiteDataStore() == &pageConfiguration->websiteDataStore()->websiteDataStore());
- } else
- process = &processForRegistrableDomain(pageConfiguration->websiteDataStore()->websiteDataStore(), nullptr, { });
- } else {
+ if (pageConfiguration->relatedPage()) {
+ // Sharing processes, e.g. when creating the page via window.open().
+ process = &pageConfiguration->relatedPage()->process();
+ // We do not support several WebsiteDataStores sharing a single process.
+ ASSERT(process.get() == m_dummyProcessProxy || &pageConfiguration->websiteDataStore()->websiteDataStore() == &process->websiteDataStore());
+ ASSERT(&pageConfiguration->relatedPage()->websiteDataStore() == &pageConfiguration->websiteDataStore()->websiteDataStore());
+ } else if (!m_isDelayedWebProcessLaunchDisabled) {
// In the common case, we delay process launch until something is actually loaded in the page.
if (!m_dummyProcessProxy) {
auto dummyProcessProxy = WebProcessProxy::create(*this, nullptr, WebProcessProxy::IsPrewarmed::No, WebProcessProxy::ShouldLaunchProcess::No);
@@ -1229,7 +1224,8 @@
m_processes.append(WTFMove(dummyProcessProxy));
}
process = m_dummyProcessProxy;
- }
+ } else
+ process = &processForRegistrableDomain(pageConfiguration->websiteDataStore()->websiteDataStore(), nullptr, { });
ASSERT(process);
Modified: trunk/Tools/ChangeLog (244509 => 244510)
--- trunk/Tools/ChangeLog 2019-04-22 19:57:58 UTC (rev 244509)
+++ trunk/Tools/ChangeLog 2019-04-22 21:08:07 UTC (rev 244510)
@@ -1,3 +1,15 @@
+2019-04-22 Chris Dumez <cdu...@apple.com>
+
+ Unreviewed, rolling out r244502.
+
+ Caused crashes on the bots
+
+ Reverted changeset:
+
+ "Delayed WebProcessLaunch may break the _relatedWebView SPI"
+ https://bugs.webkit.org/show_bug.cgi?id=197160
+ https://trac.webkit.org/changeset/244502
+
2019-04-22 Ryan Haddad <ryanhad...@apple.com>
Unreviewed, rolling out r244437.
Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm (244509 => 244510)
--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm 2019-04-22 19:57:58 UTC (rev 244509)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm 2019-04-22 21:08:07 UTC (rev 244510)
@@ -4598,46 +4598,6 @@
runProcessSwapDueToRelatedWebViewTest([NSURL URLWithString:@"pson://www.webkit.org/main1.html"], [NSURL URLWithString:@"pson://www.webkit.org/main2.html"], ExpectSwap::No);
}
-TEST(ProcessSwap, RelatedWebViewBeforeWebProcessLaunch)
-{
- auto processPoolConfiguration = psonProcessPoolConfiguration();
- auto processPool = adoptNS([[WKProcessPool alloc] _initWithConfiguration:processPoolConfiguration.get()]);
-
- auto webView1Configuration = adoptNS([[WKWebViewConfiguration alloc] init]);
- [webView1Configuration setProcessPool:processPool.get()];
- auto handler = adoptNS([[PSONScheme alloc] init]);
- [webView1Configuration setURLSchemeHandler:handler.get() forURLScheme:@"PSON"];
-
- auto webView1 = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:webView1Configuration.get()]);
- auto delegate = adoptNS([[PSONNavigationDelegate alloc] init]);
- [webView1 setNavigationDelegate:delegate.get()];
-
- auto webView2Configuration = adoptNS([[WKWebViewConfiguration alloc] init]);
- [webView2Configuration setProcessPool:processPool.get()];
- [webView2Configuration setURLSchemeHandler:handler.get() forURLScheme:@"PSON"];
- webView2Configuration.get()._relatedWebView = webView1.get(); // webView2 will be related to webView1 and webView1's URL will be used for process swap decision.
- auto webView2 = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:webView2Configuration.get()]);
- [webView2 setNavigationDelegate:delegate.get()];
-
- NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"pson://www.webkit.org/main1.html"]];
- [webView1 loadRequest:request];
-
- TestWebKitAPI::Util::run(&done);
- done = false;
-
- auto pid1 = [webView1 _webProcessIdentifier];
-
- request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"pson://www.webkit.org/main2.html"]];
- [webView2 loadRequest:request];
-
- TestWebKitAPI::Util::run(&done);
- done = false;
-
- auto pid2 = [webView2 _webProcessIdentifier];
-
- EXPECT_EQ(pid1, pid2); // WebViews are related so they should share the same process.
-}
-
TEST(ProcessSwap, TerminatedSuspendedPageProcess)
{
auto processPoolConfiguration = psonProcessPoolConfiguration();