[PSON] We are sometimes swapping processes even though there is an opened window...
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 30 Nov 2018 22:27:18 +0000 (22:27 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 30 Nov 2018 22:27:18 +0000 (22:27 +0000)
commitf5c7116cd0d09c893ad7f6fecfa74a8ff581dd82
tree497aea99b7f01623ea12ff4dcdeed71c4283a516
parentaed6ebbbdacd5af350ff8e2d930b206cd40521db
[PSON] We are sometimes swapping processes even though there is an opened window with an opener link to us
https://bugs.webkit.org/show_bug.cgi?id=192242

Reviewed by Geoffrey Garen.

Source/WebCore:

Move the setting of the openedViaWindowOpenWithOpener & hasOpenedFrames flags on the
NavigationAction from FrameLoader::loadURL(), to PolicyChecker::checkNavigationPolicy()
to make sure those are always accurate and so that the UIProcess can make correct process
swapping decisions.

NavigationAction objects are created in other places than FrameLoader::loadURL() as well.
Even PolicyChecker::checkNavigationPolicy() will create a NavigationAction object if
there is not already one.

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadURL):
* loader/FrameLoader.h:
(WebCore::FrameLoader::hasOpenedFrames const):
* loader/PolicyChecker.cpp:
(WebCore::PolicyChecker::checkNavigationPolicy):

Tools:

Add API test coverage.

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238755 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/loader/FrameLoader.cpp
Source/WebCore/loader/FrameLoader.h
Source/WebCore/loader/PolicyChecker.cpp
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm