Changeset 238368 in webkit
- Timestamp:
- Nov 18, 2018 11:14:51 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r238361 r238368 1 2018-11-18 Chris Dumez <cdumez@apple.com> 2 3 [PSON] Received an invalid message "WebPageProxy.DidPerformClientRedirect" from the web process 4 https://bugs.webkit.org/show_bug.cgi?id=191828 5 6 Reviewed by Antti Koivisto. 7 8 WebPageProxy::didPerformClientRedirect() had a MESSAGE_CHECK_URL() for both the source 9 and the destination URL. The macro calls WebProcessProxy::checkURLReceivedFromWebProcess() 10 to make sure that both URLs were actually loaded by this WebContent process. 11 12 However, now that we're enabled process-swap on cross-site navigation, these checks are no 13 longer fully valid. If the client-side redirect is cross-site, then the source and destination 14 URLs get loaded by 2 different WebContent processes. Since didPerformClientRedirect() gets 15 called after the redirect and gets set by the new WebContent process, only the destination URL 16 is guaranteed to have been loaded by this process. The source URL may have been loaded in 17 another process so this patch drops the message check for the source URL. 18 19 * UIProcess/WebPageProxy.cpp: 20 (WebKit::WebPageProxy::didPerformClientRedirect): 21 1 22 2018-11-18 Yusuke Suzuki <yusukesuzuki@slowstart.org> 2 23 -
trunk/Source/WebKit/UIProcess/WebPageProxy.cpp
r238358 r238368 4443 4443 MESSAGE_CHECK(frame); 4444 4444 MESSAGE_CHECK(frame->page() == this); 4445 4446 MESSAGE_CHECK_URL(sourceURLString);4447 4445 MESSAGE_CHECK_URL(destinationURLString); 4448 4446 -
trunk/Tools/ChangeLog
r238360 r238368 1 2018-11-18 Chris Dumez <cdumez@apple.com> 2 3 [PSON] Received an invalid message "WebPageProxy.DidPerformClientRedirect" from the web process 4 https://bugs.webkit.org/show_bug.cgi?id=191828 5 6 Reviewed by Antti Koivisto. 7 8 Add API test coverage. 9 10 * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: 11 * TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm: 12 * TestWebKitAPI/Tests/WebKitCocoa/client-side-redirect.html: Added. 13 1 14 2018-11-17 Wenson Hsieh <wenson_hsieh@apple.com> 2 15 -
trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
r238306 r238368 588 588 83779C381F82FECE007CDA8A /* VisitedLinkStore.mm in Sources */ = {isa = PBXBuildFile; fileRef = 83779C371F82FEB0007CDA8A /* VisitedLinkStore.mm */; }; 589 589 837A35F11D9A1E7D00663C57 /* DownloadRequestBlobURL.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 837A35F01D9A1E6400663C57 /* DownloadRequestBlobURL.html */; }; 590 839AA35F21A26B0300980DD6 /* client-side-redirect.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 839AA35E21A26ACD00980DD6 /* client-side-redirect.html */; }; 590 591 83B6DE6F1EE75221001E792F /* RestoreSessionState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83B6DE6E1EE7520F001E792F /* RestoreSessionState.cpp */; }; 591 592 83BAEE8D1EF4625500DDE894 /* PluginLoadClientPolicies.mm in Sources */ = {isa = PBXBuildFile; fileRef = 83BAEE8C1EF4625500DDE894 /* PluginLoadClientPolicies.mm */; }; … … 999 1000 2EFF06C71D886A580004BB30 /* change-video-source-on-end.html in Copy Resources */, 1000 1001 9BD4239C1E04C01C00200395 /* chinese-character-with-image.html in Copy Resources */, 1002 839AA35F21A26B0300980DD6 /* client-side-redirect.html in Copy Resources */, 1001 1003 1A50AA201A2A51FC00F4C345 /* close-from-within-create-page.html in Copy Resources */, 1002 1004 9B270FEE1DDC2C0B002D53F3 /* closed-shadow-tree-test.html in Copy Resources */, … … 1737 1739 83779C371F82FEB0007CDA8A /* VisitedLinkStore.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = VisitedLinkStore.mm; sourceTree = "<group>"; }; 1738 1740 837A35F01D9A1E6400663C57 /* DownloadRequestBlobURL.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = DownloadRequestBlobURL.html; sourceTree = "<group>"; }; 1741 839AA35E21A26ACD00980DD6 /* client-side-redirect.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "client-side-redirect.html"; sourceTree = "<group>"; }; 1739 1742 83B6DE6E1EE7520F001E792F /* RestoreSessionState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RestoreSessionState.cpp; sourceTree = "<group>"; }; 1740 1743 83B88A331C80056D00BB2418 /* HTMLParserIdioms.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLParserIdioms.cpp; sourceTree = "<group>"; }; … … 2721 2724 2EFF06C41D8867700004BB30 /* change-video-source-on-click.html */, 2722 2725 2EFF06C61D886A560004BB30 /* change-video-source-on-end.html */, 2726 839AA35E21A26ACD00980DD6 /* client-side-redirect.html */, 2723 2727 E5036F77211BC22800BFDBE2 /* color-drop.html */, 2724 2728 F4B825D61EF4DBD4006E417F /* compressed-files.zip */, -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm
r238356 r238368 1458 1458 } 1459 1459 1460 TEST(ProcessSwap, CrossSiteClientSideRedirectFromFileURL) 1461 { 1462 auto processPoolConfiguration = adoptNS([[_WKProcessPoolConfiguration alloc] init]); 1463 processPoolConfiguration.get().processSwapsOnNavigation = YES; 1464 processPoolConfiguration.get().prewarmsProcessesAutomatically = YES; 1465 auto processPool = adoptNS([[WKProcessPool alloc] _initWithConfiguration:processPoolConfiguration.get()]); 1466 1467 auto webViewConfiguration = adoptNS([[WKWebViewConfiguration alloc] init]); 1468 [webViewConfiguration setProcessPool:processPool.get()]; 1469 auto handler = adoptNS([[PSONScheme alloc] init]); 1470 [webViewConfiguration setURLSchemeHandler:handler.get() forURLScheme:@"pson"]; 1471 1472 auto webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:webViewConfiguration.get()]); 1473 auto delegate = adoptNS([[PSONNavigationDelegate alloc] init]); 1474 [webView setNavigationDelegate:delegate.get()]; 1475 1476 willPerformClientRedirect = false; 1477 didPerformClientRedirect = false; 1478 1479 NSURLRequest *request = [NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:@"client-side-redirect" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]]; 1480 [webView loadRequest:request]; 1481 1482 TestWebKitAPI::Util::run(&done); 1483 done = false; 1484 1485 auto pid1 = [webView _webProcessIdentifier]; 1486 1487 TestWebKitAPI::Util::run(&done); 1488 done = false; 1489 1490 auto pid2 = [webView _webProcessIdentifier]; 1491 EXPECT_NE(pid1, pid2); 1492 1493 EXPECT_EQ(2U, [processPool _webProcessCountIgnoringPrewarmed]); 1494 EXPECT_TRUE(willPerformClientRedirect); 1495 EXPECT_TRUE(didPerformClientRedirect); 1496 } 1497 1460 1498 static void runNavigationWithLockedHistoryTest(ShouldEnablePSON shouldEnablePSON) 1461 1499 {
Note: See TracChangeset
for help on using the changeset viewer.