[PSON] Request by the client to process-swap is ignored if the window has an opener
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 3 Dec 2018 23:57:41 +0000 (23:57 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 3 Dec 2018 23:57:41 +0000 (23:57 +0000)
commit52dbcf3fd38e5c968e5e276faa5a97218efd6d0d
treed7370875301ba9d09b45c1c05355219d2c790d37
parent13b1b950c3be7ba7bdf3b152c4326f7e36b572f0
[PSON] Request by the client to process-swap is ignored if the window has an opener
https://bugs.webkit.org/show_bug.cgi?id=192267
<rdar://problem/46386886>

Reviewed by Brady Eidson.

Source/WebKit:

If the client forces a process-swap, we should process-swap, even if the browsing
context has an opener (or openees). Previously, we would only bypass the cross-site
check, not the openee / openees checks.

The issue when doing so is that the openee still has a opener link to the window
in the old process. They would see that the window is still there and navigated
to 'about:blank' due to our page suspension logic. To address the issue, we no
longer suspend the old WebPage if the process swap was forced by the client and
we make sure that the old WebPage gets closed.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::suspendCurrentPageIfPossible):
(WebKit::WebPageProxy::swapToWebProcess):
(WebKit::WebPageProxy::receivedNavigationPolicyDecision):
(WebKit::WebPageProxy::continueNavigationInNewProcess):
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::processForNavigationInternal):

Tools:

Add API test coverage.

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238826 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/WebPageProxy.cpp
Source/WebKit/UIProcess/WebPageProxy.h
Source/WebKit/UIProcess/WebProcessPool.cpp
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm