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

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

Issue 1944013003: Move ownership of source SiteInstance to the FrameNavigationEntry. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Another round of review comments addressed. Created 4 years, 7 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
Index: content/browser/frame_host/navigator_impl.cc
diff --git a/content/browser/frame_host/navigator_impl.cc b/content/browser/frame_host/navigator_impl.cc
index e9d4f7bb2c6742cc9dd855f703f50553376997a8..6fcdb074b4a0f6badd1ea04256214a7e2223480d 100644
--- a/content/browser/frame_host/navigator_impl.cc
+++ b/content/browser/frame_host/navigator_impl.cc
@@ -773,19 +773,20 @@ void NavigatorImpl::RequestTransferURL(
}
// TODO(creis): Handle POST submissions. See https://crbug.com/582211 and
// https://crbug.com/101395.
- entry->AddOrUpdateFrameEntry(node, -1, -1, nullptr, dest_url,
- referrer_to_use, PageState(), "GET", -1);
+ entry->AddOrUpdateFrameEntry(
+ node, -1, -1, nullptr,
+ static_cast<SiteInstanceImpl*>(source_site_instance), dest_url,
+ referrer_to_use, PageState(), "GET", -1);
} else {
// Main frame case.
entry = NavigationEntryImpl::FromNavigationEntry(
controller_->CreateNavigationEntry(
dest_url, referrer_to_use, page_transition, is_renderer_initiated,
std::string(), controller_->GetBrowserContext()));
+ entry->root_node()->frame_entry->set_source_site_instance(
+ static_cast<SiteInstanceImpl*>(source_site_instance));
}
- // The source_site_instance may matter for navigations via RenderFrameProxy.
- entry->set_source_site_instance(
- static_cast<SiteInstanceImpl*>(source_site_instance));
entry->SetRedirectChain(redirect_chain);
// Don't allow an entry replacement if there is no entry to replace.
// http://crbug.com/457149
@@ -806,9 +807,10 @@ void NavigatorImpl::RequestTransferURL(
scoped_refptr<FrameNavigationEntry> frame_entry(entry->GetFrameEntry(node));
if (!frame_entry) {
// TODO(creis): Handle POST submissions here, as above.
- frame_entry =
- new FrameNavigationEntry(node->unique_name(), -1, -1, nullptr, dest_url,
- referrer_to_use, "GET", -1);
+ frame_entry = new FrameNavigationEntry(
+ node->unique_name(), -1, -1, nullptr,
+ static_cast<SiteInstanceImpl*>(source_site_instance), dest_url,
+ referrer_to_use, "GET", -1);
}
NavigateToEntry(node, *frame_entry, *entry.get(),
NavigationController::NO_RELOAD, false, false);
« no previous file with comments | « content/browser/frame_host/navigation_request.cc ('k') | content/browser/frame_host/render_frame_host_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698