Commit 6b75c0d2 authored by Lukasz Anforowicz's avatar Lukasz Anforowicz Committed by Chromium LUCI CQ

Use NavigationEntry::IsRestored instead of inspecting RestoreType.

Bug: 1150940
Change-Id: Iadb1260fa89c4b9d3693cc0fbc5dcad7aab47535
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2550343
Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
Reviewed-by: default avatarNasko Oskov <nasko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#832558}
parent 992806db
...@@ -320,7 +320,7 @@ mojom::NavigationType GetNavigationType(const GURL& old_url, ...@@ -320,7 +320,7 @@ mojom::NavigationType GetNavigationType(const GURL& old_url,
break; // Fall through to rest of function. break; // Fall through to rest of function.
} }
if (entry->restore_type() != RestoreType::NONE) { if (entry->IsRestored()) {
return entry->GetHasPostData() ? mojom::NavigationType::RESTORE_WITH_POST return entry->GetHasPostData() ? mojom::NavigationType::RESTORE_WITH_POST
: mojom::NavigationType::RESTORE; : mojom::NavigationType::RESTORE;
} }
...@@ -1093,8 +1093,8 @@ bool NavigationControllerImpl::RendererDidNavigate( ...@@ -1093,8 +1093,8 @@ bool NavigationControllerImpl::RendererDidNavigate(
// except for restored entries. // except for restored entries.
bool was_restored = false; bool was_restored = false;
DCHECK(pending_entry_index_ == -1 || pending_entry_->site_instance() || DCHECK(pending_entry_index_ == -1 || pending_entry_->site_instance() ||
pending_entry_->restore_type() != RestoreType::NONE); pending_entry_->IsRestored());
if (pending_entry_ && pending_entry_->restore_type() != RestoreType::NONE) { if (pending_entry_ && pending_entry_->IsRestored()) {
pending_entry_->set_restore_type(RestoreType::NONE); pending_entry_->set_restore_type(RestoreType::NONE);
was_restored = true; was_restored = true;
} }
...@@ -2712,7 +2712,7 @@ void NavigationControllerImpl::NavigateToExistingPendingEntry( ...@@ -2712,7 +2712,7 @@ void NavigationControllerImpl::NavigateToExistingPendingEntry(
// from happening, we drop the navigation here and stop the slow-to-commit // from happening, we drop the navigation here and stop the slow-to-commit
// page from loading (which would normally happen during the navigation). // page from loading (which would normally happen during the navigation).
if (pending_entry_index_ == last_committed_entry_index_ && if (pending_entry_index_ == last_committed_entry_index_ &&
pending_entry_->restore_type() == RestoreType::NONE && !pending_entry_->IsRestored() &&
pending_entry_->GetTransitionType() & ui::PAGE_TRANSITION_FORWARD_BACK) { pending_entry_->GetTransitionType() & ui::PAGE_TRANSITION_FORWARD_BACK) {
delegate_->Stop(); delegate_->Stop();
......
...@@ -384,9 +384,8 @@ class RenderFrameHostManagerTest ...@@ -384,9 +384,8 @@ class RenderFrameHostManagerTest
->navigator() ->navigator()
.GetController()); .GetController());
mojom::NavigationType navigate_type = mojom::NavigationType navigate_type =
entry->restore_type() == RestoreType::NONE entry->IsRestored() ? mojom::NavigationType::RESTORE
? mojom::NavigationType::DIFFERENT_DOCUMENT : mojom::NavigationType::DIFFERENT_DOCUMENT;
: mojom::NavigationType::RESTORE;
scoped_refptr<network::ResourceRequestBody> request_body; scoped_refptr<network::ResourceRequestBody> request_body;
std::string post_content_type; std::string post_content_type;
if (frame_entry->method() == "POST") { if (frame_entry->method() == "POST") {
......
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