Index: content/browser/frame_host/navigation_controller_impl.cc |
diff --git a/content/browser/frame_host/navigation_controller_impl.cc b/content/browser/frame_host/navigation_controller_impl.cc |
index 194a0e87499083a111e4e0f7db41cbe078dba168..c2b1bdd9eefd39230ea9e4cd05f0f142df97f6a1 100644 |
--- a/content/browser/frame_host/navigation_controller_impl.cc |
+++ b/content/browser/frame_host/navigation_controller_impl.cc |
@@ -750,7 +750,7 @@ void NavigationControllerImpl::LoadURLWithParams(const LoadURLParams& params) { |
entry = GetLastCommittedEntry()->Clone(); |
entry->SetPageID(-1); |
entry->AddOrUpdateFrameEntry(node, "", -1, -1, nullptr, params.url, |
- params.referrer, PageState()); |
+ params.referrer, ExplodedFrameState()); |
} |
} |
} |
@@ -900,7 +900,10 @@ bool NavigationControllerImpl::RendererDidNavigate( |
// All committed entries should have nonempty content state so WebKit doesn't |
// get confused when we go back to them (see the function for details). |
- DCHECK(params.page_state.IsValid()); |
+ if (SiteIsolationPolicy::UseSubframeNavigationEntries()) |
+ DCHECK(params.frame_state.item_sequence_number); |
+ else |
+ DCHECK(params.page_state.IsValid()); |
NavigationEntryImpl* active_entry = GetLastCommittedEntry(); |
active_entry->SetTimestamp(timestamp); |
active_entry->SetHttpStatusCode(params.http_status_code); |
@@ -910,8 +913,10 @@ bool NavigationControllerImpl::RendererDidNavigate( |
active_entry->GetFrameEntry(rfh->frame_tree_node()); |
// We may not find a frame_entry in some cases; ignore the PageState if so. |
// TODO(creis): Remove the "if" once https://crbug.com/522193 is fixed. |
- if (frame_entry) |
- frame_entry->set_page_state(params.page_state); |
+ if (frame_entry) { |
+ frame_entry->set_frame_state(params.frame_state); |
+ active_entry->UpdatePageState(); |
+ } |
} else { |
active_entry->SetPageState(params.page_state); |
} |
@@ -1324,7 +1329,8 @@ bool NavigationControllerImpl::RendererDidNavigateAutoSubframe( |
last_committed->AddOrUpdateFrameEntry( |
rfh->frame_tree_node(), params.frame_unique_name, |
params.item_sequence_number, params.document_sequence_number, |
- rfh->GetSiteInstance(), params.url, params.referrer, params.page_state); |
+ rfh->GetSiteInstance(), params.url, params.referrer, |
+ params.frame_state); |
// Cross-process subframe navigations may leave a pending entry around. |
// Clear it if it's actually for the subframe. |
@@ -1847,11 +1853,12 @@ void NavigationControllerImpl::FindFramesToNavigate( |
return; |
// Schedule a load in this frame if the new item isn't for the same item |
- // sequence number in the same SiteInstance. |
- // TODO(creis): Handle null SiteInstances during session restore. |
+ // sequence number in the same SiteInstance. Newly restored items may not have |
+ // SiteInstances yet, in which case it will be assigned on first commit. |
if (!old_item || |
new_item->item_sequence_number() != old_item->item_sequence_number() || |
- new_item->site_instance() != old_item->site_instance()) { |
+ (new_item->site_instance() != nullptr && |
+ new_item->site_instance() != old_item->site_instance())) { |
if (old_item && |
new_item->document_sequence_number() == |
old_item->document_sequence_number()) { |