Commit 44a9864d authored by Gauthier Ambard's avatar Gauthier Ambard Committed by Commit Bot

[iOS] Finalize session restore when committing item

This CL makes sure to call FinalizeSessionRestore when resetting the
restored_visible_item when an item is being committed.

Fixed: 1127434
Change-Id: Idb6ca7ed3a2267dd5343b471c67251c756c8387c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2421113Reviewed-by: default avatarJustin Cohen <justincohen@chromium.org>
Reviewed-by: default avatarAli Juma <ajuma@chromium.org>
Commit-Queue: Gauthier Ambard <gambard@chromium.org>
Cr-Commit-Position: refs/heads/master@{#812014}
parent ea8aea41
...@@ -83,8 +83,16 @@ void WKBasedNavigationManagerImpl::OnNavigationItemCommitted() { ...@@ -83,8 +83,16 @@ void WKBasedNavigationManagerImpl::OnNavigationItemCommitted() {
DCHECK(item); DCHECK(item);
delegate_->OnNavigationItemCommitted(item); delegate_->OnNavigationItemCommitted(item);
if (!wk_navigation_util::IsRestoreSessionUrl(item->GetURL())) if (!wk_navigation_util::IsRestoreSessionUrl(item->GetURL())) {
restored_visible_item_.reset(); restored_visible_item_.reset();
if (is_restore_session_in_progress_) {
// There are crashes because restored_visible_item_ is nil and
// is_restore_session_in_progress_ is true. This is a speculative fix,
// based on the idea that a navigation item could be committed before
// OnNavigationStarted is called. See crbug.com/1127434.
FinalizeSessionRestore();
}
}
} }
void WKBasedNavigationManagerImpl::OnNavigationStarted(const GURL& url) { void WKBasedNavigationManagerImpl::OnNavigationStarted(const GURL& url) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment