Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1749)

Unified Diff: content/browser/frame_host/navigation_entry_impl.cc

Issue 2136873002: Clear child FrameNavigationEntries if a history navigation redirects. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Disable test on PlzNavigate. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/frame_host/navigation_entry_impl.h ('k') | content/renderer/history_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/navigation_entry_impl.cc
diff --git a/content/browser/frame_host/navigation_entry_impl.cc b/content/browser/frame_host/navigation_entry_impl.cc
index 0d4f9f0d72f4941f5945a61f8451f3b912ec4f48..6baa2a7fbd5ddd817b9ecfd74524e70a65e96eac 100644
--- a/content/browser/frame_host/navigation_entry_impl.cc
+++ b/content/browser/frame_host/navigation_entry_impl.cc
@@ -714,6 +714,12 @@ void NavigationEntryImpl::AddOrUpdateFrameEntry(
const std::string& unique_name = frame_tree_node->unique_name();
for (TreeNode* child : parent_node->children) {
if (child->frame_entry->frame_unique_name() == unique_name) {
+ // If the document of the FrameNavigationEntry is changing, we must clear
+ // any child FrameNavigationEntries.
+ if (child->frame_entry->document_sequence_number() !=
+ document_sequence_number)
+ child->children.clear();
+
// Update the existing FrameNavigationEntry (e.g., for replaceState).
child->frame_entry->UpdateEntry(unique_name, item_sequence_number,
document_sequence_number, site_instance,
@@ -741,6 +747,12 @@ FrameNavigationEntry* NavigationEntryImpl::GetFrameEntry(
return tree_node ? tree_node->frame_entry.get() : nullptr;
}
+void NavigationEntryImpl::ClearChildren(FrameTreeNode* frame_tree_node) {
+ NavigationEntryImpl::TreeNode* tree_node = FindFrameEntry(frame_tree_node);
+ if (tree_node)
+ tree_node->children.clear();
+}
+
void NavigationEntryImpl::SetScreenshotPNGData(
scoped_refptr<base::RefCountedBytes> png_data) {
screenshot_ = png_data;
« no previous file with comments | « content/browser/frame_host/navigation_entry_impl.h ('k') | content/renderer/history_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698