Regression(PSON) Content blockers are sometimes lost on back navigation cross-site
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 Jan 2019 23:02:55 +0000 (23:02 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 Jan 2019 23:02:55 +0000 (23:02 +0000)
commitc6f8e8dafcbf7c663e6b524c90b0345f5fc23bed
tree39bc7396c862580e3e2f4210d5803dbe9d3f5ac0
parentf6dfbc605328642d0acaaf6d64d3dfe2ea0d4662
Regression(PSON) Content blockers are sometimes lost on back navigation cross-site
https://bugs.webkit.org/show_bug.cgi?id=193588
<rdar://problem/47131566>

Reviewed by Alex Christensen.

Source/WebKit:

When the WebPageProxy needs to create initialization parameters for its WebPage in the
WebContent process, it calls WebProcessProxy::addWebUserContentControllerProxy()
which calls WebUserContentControllerProxy::addProcess(). This last call is supposed to
register the WebProcessProxy with the WebUserContentControllerProxy and adding the
contentRuleLists to the WebPageCreationParameters. The issue is that if the
WebUserContentControllerProxy already knows about this WebProcessProxy, it would return
early and not populate the WebPageCreationParameters.

In PSON world, when navigating back to a page that failed to enter page cache, we reuse
the process where we previously loaded the page but re-create a new WebPage on the
WebContent process site. When this happens, WebUserContentControllerProxy would not
add the contentRuleLists to the WebPageCreationParameters and the new WebPage in the
previously-suspended process would be missing them.

* UIProcess/UserContent/WebUserContentControllerProxy.cpp:
(WebKit::WebUserContentControllerProxy::addProcess):

Tools:

Add layout test coverage.

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

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