Regression(PSON): "Swipe back" snapshot is missing when navigating back cross-process
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Sep 2018 17:42:28 +0000 (17:42 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Sep 2018 17:42:28 +0000 (17:42 +0000)
commitda769fb7b89dd2072b4799bb70af7ca3d6491784
treed8a32127ba613fe121d3de9a918a868dc8e82e37
parent95a6ea97d0e419297988458f39248873231a6943
Regression(PSON): "Swipe back" snapshot is missing when navigating back cross-process
https://bugs.webkit.org/show_bug.cgi?id=189482
<rdar://problem/44317222>

Reviewed by Geoffrey Garen.

The issue was that when we swap process on navigation, we:
1. Call processDidTerminate() which calls resetState() and clears the displayed content
2. Reattach the WebPageProxy to a new WebProcess
3. Trigger the navigation
4. Take the navigation snapshot

When the navigation snapshot occurs at step 4, the view is already blank in the case of
process swap. To avoid the issue, we take the navigation snapshot earlier, before calling
processDidTerminate() and we suppress the next navigation snapshot as it would be blank.

At some point, we will likely want to display the previous' WebProcess content longer,
until the new WebProcess has something interesting to display. Once this is implemented,
we'll likely be able to drop the early snapshotting logic.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::recordAutomaticNavigationSnapshot):
(WebKit::WebPageProxy::continueNavigationInNewProcess):
(WebKit::WebPageProxy::restoreFromSessionState):
(WebKit::WebPageProxy::didCommitLoadForFrame):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::suppressNextAutomaticNavigationSnapshot):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235898 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/WebPageProxy.cpp
Source/WebKit/UIProcess/WebPageProxy.h