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

Unified Diff: content/browser/tab_contents/tab_contents.cc

Issue 8372036: Ensure forced process swaps use the correct page_id and SiteInstance. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 2 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/tab_contents/tab_contents.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/tab_contents/tab_contents.cc
diff --git a/content/browser/tab_contents/tab_contents.cc b/content/browser/tab_contents/tab_contents.cc
index 9a763e9a85b67e6b0c41c754b37ee8ea1bcd56d7..db8b013be69812d552ed7aa3b831931ad6153fcb 100644
--- a/content/browser/tab_contents/tab_contents.cc
+++ b/content/browser/tab_contents/tab_contents.cc
@@ -575,7 +575,7 @@ bool TabContents::NavigateToPendingEntry(
}
bool TabContents::NavigateToEntry(
- const NavigationEntry& entry,
+ NavigationEntry& entry,
jam 2011/11/01 19:14:33 this is against the google style guide, so you wil
Charlie Reis 2011/11/01 19:16:27 Will do.
Charlie Reis 2011/11/01 19:25:45 Done.
NavigationController::ReloadType reload_type) {
// The renderer will reject IPC messages with URLs longer than
// this limit, so don't attempt to navigate with a longer URL.
@@ -586,6 +586,13 @@ bool TabContents::NavigateToEntry(
if (!dest_render_view_host)
return false; // Unable to create the desired render view host.
+ // If we were forced to swap the entry's existing SiteInstance, we need to
+ // update it before the navigation begins so that we can find it when the
+ // navigation commits.
+ if (entry.site_instance() &&
+ entry.site_instance() != dest_render_view_host->site_instance())
+ entry.set_site_instance(dest_render_view_host->site_instance());
+
// For security, we should never send non-Web-UI URLs to a Web UI renderer.
// Double check that here.
int enabled_bindings = dest_render_view_host->enabled_bindings();
« no previous file with comments | « content/browser/tab_contents/tab_contents.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698