AppHistory should restore sameDocument / state in non-current entries
When navigating cross-document, AppHistory reconstructs its entries()
array from information provided by the browser process. It has much
less information for the non-current entries, but that information
should include everything exposed by the AppHistory API.
Currently, the sameDocument bit and state value are not restored, so
they will have default values (false and undefined, respectively).
Actually plumb and restore them.
Bug: 1269851
Change-Id: I58ea07349ef849f1362e0dc24411f3d266e6d095
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3279565
Commit-Queue: Nate Chapin <[email protected]>
Reviewed-by: Rakina Zata Amni <[email protected]>
Reviewed-by: Daniel Cheng <[email protected]>
Reviewed-by: Domenic Denicola <[email protected]>
Cr-Commit-Position: refs/heads/main@{#943277}
diff --git a/content/browser/renderer_host/navigation_controller_impl.cc b/content/browser/renderer_host/navigation_controller_impl.cc
index d4d8c4f0..ab290c0b 100644
--- a/content/browser/renderer_host/navigation_controller_impl.cc
+++ b/content/browser/renderer_host/navigation_controller_impl.cc
@@ -4100,7 +4100,10 @@
blink::mojom::AppHistoryEntry::New(
frame_state.app_history_key.value_or(std::u16string()),
frame_state.app_history_id.value_or(std::u16string()),
- frame_state.url_string.value_or(std::u16string()));
+ frame_state.url_string.value_or(std::u16string()),
+ frame_state.item_sequence_number,
+ frame_state.document_sequence_number,
+ frame_state.app_history_state.value_or(std::u16string()));
DCHECK(pending_origin.CanBeDerivedFrom(GURL(entry->url)));
entries.push_back(std::move(entry));
previous_item_sequence_number = frame_entry->item_sequence_number();