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

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

Issue 1143653002: Create FrameNavigationEntries for manual subframe navigations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 6 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 | « no previous file | content/browser/frame_host/navigation_controller_impl_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 5d4dee8bb4f528239f5aa090c019182e197bf25f..0491cfb0794e3e3b497d048ce104a8d52b42f3e6 100644
--- a/content/browser/frame_host/navigation_controller_impl.cc
+++ b/content/browser/frame_host/navigation_controller_impl.cc
@@ -1393,7 +1393,21 @@ void NavigationControllerImpl::RendererDidNavigateNewSubframe(
// band with the actual navigations.
DCHECK(GetLastCommittedEntry()) << "ClassifyNavigation should guarantee "
<< "that a last committed entry exists.";
- NavigationEntryImpl* new_entry = GetLastCommittedEntry()->Clone();
+
+ NavigationEntryImpl* new_entry = nullptr;
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kSitePerProcess)) {
+ // Make sure new_entry takes ownership of frame_entry in a scoped_refptr.
+ FrameNavigationEntry* frame_entry = new FrameNavigationEntry(
+ rfh->frame_tree_node()->frame_tree_node_id(), rfh->GetSiteInstance(),
+ params.url, params.referrer);
+ new_entry = GetLastCommittedEntry()->CloneAndReplace(rfh->frame_tree_node(),
+ frame_entry);
+ CHECK(frame_entry->HasOneRef());
+ } else {
+ new_entry = GetLastCommittedEntry()->Clone();
+ }
+
new_entry->SetPageID(params.page_id);
InsertOrReplaceEntry(new_entry, false);
}
« no previous file with comments | « no previous file | content/browser/frame_host/navigation_controller_impl_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698