Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Take navigation snapshots whenever the current back-forward item is g…
…oing to change https://bugs.webkit.org/show_bug.cgi?id=135058 <rdar://problem/17464515> Reviewed by Dan Bernstein. Instead of trying to have the UI process figure out when to take navigation snapshots by itself, snapshot whenever the Web process says that the current back-forward item is going to change. This fixes snapshotting timing with pushState, and lets us bottleneck snapshotting down to just two places instead of 5. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::goForward): (WebKit::WebPageProxy::goBack): (WebKit::WebPageProxy::goToBackForwardItem): (WebKit::WebPageProxy::didStartProvisionalLoadForFrame): We no longer need to special-case taking navigation snapshots when the UI process changes the back forward item or upon didStartProvisionalLoadForFrame, because we'll always snapshot in willChangeCurrentHistoryItem in all of these cases. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::willChangeCurrentHistoryItem): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: Add willChangeCurrentHistoryItem message, which comes from the Web process. When it arrives, take a navigation snapshot. * UIProcess/ios/ViewGestureControllerIOS.mm: (WebKit::ViewGestureController::beginSwipeGesture): Take the pre-swipe navigation snapshot before telling WebPageProxy that we're doing a swipe, so that it doesn't bail from taking the snapshot because we have a snapshot up. (WebKit::ViewGestureController::endSwipeGesture): We no longer need to explicitly disable snapshotting while navigating, because we will avoid taking the snapshot if there's a snapshot being displayed. * UIProcess/mac/ViewGestureControllerMac.mm: (WebKit::ViewGestureController::~ViewGestureController): Remove the snapshot if it's still up when ViewGestureController is destroyed. The Mac version of ViewGestureController is destroyed on Web process crashes because it is a message receiver, so it is not guaranteed to have the same lifetime as the WebPageProxy and friends. (WebKit::ViewGestureController::trackSwipeGesture): Make use of recordNavigationSnapshot. (WebKit::ViewGestureController::endSwipeGesture): Ditto from the Mac version. * UIProcess/mac/ViewSnapshotStore.h: (WebKit::ViewSnapshotStore::disableSnapshotting): Deleted. (WebKit::ViewSnapshotStore::enableSnapshotting): Deleted. * UIProcess/mac/ViewSnapshotStore.mm: (WebKit::ViewSnapshotStore::ViewSnapshotStore): (WebKit::ViewSnapshotStore::recordSnapshot): Remove the snapshot disabling mechanism and bail from snapshotting if we're showing a snapshot, as mentioned above. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::willChangeCurrentHistoryItem): * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::willChangeCurrentHistoryItem): * WebProcess/WebPage/WebPage.h: Proxy willChangeCurrentHistoryItem from HistoryController to the UI process. * loader/HistoryController.cpp: (WebCore::HistoryController::updateForCommit): (WebCore::HistoryController::recursiveUpdateForCommit): (WebCore::HistoryController::recursiveUpdateForSameDocumentNavigation): (WebCore::HistoryController::createItem): Use setCurrentItem instead of duplicating the contents of it inside each of these functions. (WebCore::HistoryController::setCurrentItem): (WebCore::HistoryController::replaceCurrentItem): When setting or replacing the current item, let the FrameLoaderClient know that we're going to change which history item is "current". * loader/FrameLoaderClient.h: (WebCore::FrameLoaderClient::willChangeCurrentHistoryItem): Added. Canonical link: https://commits.webkit.org/152972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@171239 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
1 parent
26eafaa
commit 7aefae8
Showing
15 changed files
with
139 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters