Diff
Modified: trunk/Source/WebKit/ChangeLog (253735 => 253736)
--- trunk/Source/WebKit/ChangeLog 2019-12-19 03:16:23 UTC (rev 253735)
+++ trunk/Source/WebKit/ChangeLog 2019-12-19 05:27:27 UTC (rev 253736)
@@ -1,3 +1,17 @@
+2019-12-18 Commit Queue <[email protected]>
+
+ Unreviewed, rolling out r253646.
+ https://bugs.webkit.org/show_bug.cgi?id=205433
+
+ "We think this may have caused a membuster regression, so
+ rolling it out." (Requested by nham on #webkit).
+
+ Reverted changeset:
+
+ "Navigation from empty page doesn't use cached web process"
+ https://bugs.webkit.org/show_bug.cgi?id=205015
+ https://trac.webkit.org/changeset/253646
+
2019-12-18 Alex Christensen <[email protected]>
Add SPI WKWebView._updateWebpagePreferences to replace _updateWebsitePolicies
Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h (253735 => 253736)
--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h 2019-12-19 03:16:23 UTC (rev 253735)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h 2019-12-19 05:27:27 UTC (rev 253736)
@@ -59,6 +59,4 @@
@property (nonatomic, readonly) BOOL _hasServiceWorkerForegroundActivityForTesting;
- (void)_setAssertionStateForTesting:(int)state;
-- (void)_ensureRunningProcessForTesting;
-
@end
Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewTesting.mm (253735 => 253736)
--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewTesting.mm 2019-12-19 03:16:23 UTC (rev 253735)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewTesting.mm 2019-12-19 05:27:27 UTC (rev 253736)
@@ -202,9 +202,4 @@
#endif
}
-- (void)_ensureRunningProcessForTesting
-{
- _page->ensureRunningProcess();
-}
-
@end
Modified: trunk/Source/WebKit/UIProcess/WebProcessPool.cpp (253735 => 253736)
--- trunk/Source/WebKit/UIProcess/WebProcessPool.cpp 2019-12-19 03:16:23 UTC (rev 253735)
+++ trunk/Source/WebKit/UIProcess/WebProcessPool.cpp 2019-12-19 05:27:27 UTC (rev 253736)
@@ -2183,6 +2183,11 @@
if (m_automationSession)
return completionHandler(WTFMove(sourceProcess), nullptr, "An automation session is active"_s);
+ if (!sourceProcess->hasCommittedAnyProvisionalLoads()) {
+ tryPrewarmWithDomainInformation(sourceProcess, targetRegistrableDomain);
+ return completionHandler(WTFMove(sourceProcess), nullptr, "Process has not yet committed any provisional loads"_s);
+ }
+
// FIXME: We should support process swap when a window has been opened via window.open() without 'noopener'.
// The issue is that the opener has a handle to the WindowProxy.
if (navigation.openedByDOMWithOpener() && !m_configuration->processSwapsOnWindowOpenWithOpener())
@@ -2218,16 +2223,6 @@
if (navigation.treatAsSameOriginNavigation())
return completionHandler(WTFMove(sourceProcess), nullptr, "The treatAsSameOriginNavigation flag is set"_s);
- if (!sourceProcess->hasCommittedAnyProvisionalLoads()) {
- if (auto process = webProcessCache().takeProcess(targetRegistrableDomain, dataStore)) {
- RELEASE_LOG(ProcessSwapping, "(ProcessSwapping) Reusing a previously cached process with pid %i in place of pid %i that hasn't committed any provisional loads", process->processIdentifier(), sourceProcess->processIdentifier());
- return completionHandler(process.releaseNonNull(), nullptr, "Reusing cached process in place of process that hasn't committed any loads"_s);
- }
-
- tryPrewarmWithDomainInformation(sourceProcess, targetRegistrableDomain);
- return completionHandler(WTFMove(sourceProcess), nullptr, "Process has not yet committed any provisional loads"_s);
- }
-
URL sourceURL;
if (page.isPageOpenedByDOMShowingInitialEmptyDocument() && !navigation.requesterOrigin().isEmpty())
sourceURL = URL { URL(), navigation.requesterOrigin().toString() };
Modified: trunk/Tools/ChangeLog (253735 => 253736)
--- trunk/Tools/ChangeLog 2019-12-19 03:16:23 UTC (rev 253735)
+++ trunk/Tools/ChangeLog 2019-12-19 05:27:27 UTC (rev 253736)
@@ -1,3 +1,17 @@
+2019-12-18 Commit Queue <[email protected]>
+
+ Unreviewed, rolling out r253646.
+ https://bugs.webkit.org/show_bug.cgi?id=205433
+
+ "We think this may have caused a membuster regression, so
+ rolling it out." (Requested by nham on #webkit).
+
+ Reverted changeset:
+
+ "Navigation from empty page doesn't use cached web process"
+ https://bugs.webkit.org/show_bug.cgi?id=205015
+ https://trac.webkit.org/changeset/253646
+
2019-12-18 Alex Christensen <[email protected]>
Add SPI WKWebView._updateWebpagePreferences to replace _updateWebsitePolicies
Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm (253735 => 253736)
--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm 2019-12-19 03:16:23 UTC (rev 253735)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm 2019-12-19 05:27:27 UTC (rev 253736)
@@ -58,6 +58,10 @@
#import <wtf/text/StringHash.h>
#import <wtf/text/WTFString.h>
+@interface WKProcessPool ()
+- (WKContextRef)_contextForTesting;
+@end
+
static bool done;
static bool didStartProvisionalLoad;
static bool failed;
@@ -3557,72 +3561,6 @@
EXPECT_EQ(1U, [processPool _webProcessCountIgnoringPrewarmed]);
}
-TEST(ProcessSwap, UseWebProcessCacheForLoadInEmptyDocument)
-{
- auto processPoolConfiguration = psonProcessPoolConfiguration();
- auto processPool = adoptNS([[WKProcessPool alloc] _initWithConfiguration:processPoolConfiguration.get()]);
-
- auto webViewConfiguration = adoptNS([[WKWebViewConfiguration alloc] init]);
- [webViewConfiguration setProcessPool:processPool.get()];
- auto handler = adoptNS([[PSONScheme alloc] init]);
- [webViewConfiguration setURLSchemeHandler:handler.get() forURLScheme:@"PSON"];
-
- pid_t pid1 = 0;
- pid_t pid2 = 0;
- pid_t pid3 = 0;
-
- auto delegate = adoptNS([[PSONNavigationDelegate alloc] init]);
-
- @autoreleasepool {
- auto webView1 = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:webViewConfiguration.get()]);
- [webView1 setNavigationDelegate:delegate.get()];
-
- NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"pson://www.webkit.org/main1.html"]];
- [webView1 loadRequest:request];
-
- TestWebKitAPI::Util::run(&done);
- done = false;
-
- pid1 = [webView1 _webProcessIdentifier];
- EXPECT_NE(pid1, 0);
-
- request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"pson://www.apple.com/main.html"]];
- [webView1 loadRequest:request];
-
- TestWebKitAPI::Util::run(&done);
- done = false;
-
- pid2 = [webView1 _webProcessIdentifier];
- EXPECT_NE(pid2, 0);
- }
-
- auto webView2 = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:webViewConfiguration.get()]);
- [webView2 setNavigationDelegate:delegate.get()];
-
- // Force webView2 to eagerly launch a WebProcess that loads the empty document. (Safari
- // implicitly launches WebProcess to the empty document because it immediately posts a message
- // to its injected bundle after creating its WKWebView. Here we launch WebProcess explicitly.)
- [webView2 _ensureRunningProcessForTesting];
-
- // Wait for webkit.org and apple.com from webView1 to enter cached process pool.
- while ([processPool _processCacheSize] != 2)
- TestWebKitAPI::Util::sleep(0.1);
-
- NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"pson://www.webkit.org/main2.html"]];
- [webView2 loadRequest:request];
-
- TestWebKitAPI::Util::run(&done);
- done = false;
-
- pid3 = [webView2 _webProcessIdentifier];
- EXPECT_NE(pid3, 0);
-
- EXPECT_EQ(3u, seenPIDs.size());
- EXPECT_NE(pid1, pid2);
- EXPECT_NE(pid2, pid3);
- EXPECT_EQ(pid1, pid3);
-}
-
TEST(ProcessSwap, UseWebProcessCacheForLoadInNewView)
{
auto processPoolConfiguration = psonProcessPoolConfiguration();