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

Unified Diff: content/browser/frame_host/render_frame_host_manager.h

Issue 471603002: Remove dependency on NavigationEntry to get a SiteInstance (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Charlie's comments Created 6 years, 4 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/render_frame_host_manager.h
diff --git a/content/browser/frame_host/render_frame_host_manager.h b/content/browser/frame_host/render_frame_host_manager.h
index 92c31fbb1212f89f1899702fd742fe1f3572eba0..b9449c279958bd205d4d9ec2ff5bd1bc8ce6570b 100644
--- a/content/browser/frame_host/render_frame_host_manager.h
+++ b/content/browser/frame_host/render_frame_host_manager.h
@@ -386,15 +386,25 @@ class CONTENT_EXPORT RenderFrameHostManager : public NotificationObserver {
// switch. Can be overridden in unit tests.
bool ShouldTransitionCrossSite();
- // Returns true if for the navigation from |current_entry| to |new_entry|,
- // a new SiteInstance and BrowsingInstance should be created (even if we are
- // in a process model that doesn't usually swap). This forces a process swap
- // and severs script connections with existing tabs. Cases where this can
- // happen include transitions between WebUI and regular web pages.
- // Either of the entries may be NULL.
+ // Returns true if for the navigation from |current_effective_url| to
+ // |new_effective_url|, a new SiteInstance and BrowsingInstance should be
+ // created (even if we are in a process model that doesn't usually swap).
+ // This forces a process swap and severs script connections with existing
+ // tabs. Cases where this can happen include transitions between WebUI and
+ // regular web pages. |new_site_instance| may be null.
+ // If there is no current NavigationEntry, then |current_is_view_source_mode|
+ // should be the same as |new_is_view_source_mode|.
+ //
+ // We use the effective URL here, since that's what is used in the
+ // SiteInstance's site and when we later call IsSameWebSite. If there is no
+ // current NavigationEntry, check the current SiteInstance's site, which might
+ // already be committed to a Web UI URL (such as the NTP).
bool ShouldSwapBrowsingInstancesForNavigation(
- const NavigationEntry* current_entry,
- const NavigationEntryImpl* new_entry) const;
+ const GURL& current_effective_url,
+ bool current_is_view_source_mode,
+ SiteInstance* new_site_instance,
+ const GURL& new_effective_url,
+ bool new_is_view_source_mode) const;
// Returns true if it is safe to reuse the current WebUI when navigating from
// |current_entry| to |new_entry|.
@@ -402,12 +412,16 @@ class CONTENT_EXPORT RenderFrameHostManager : public NotificationObserver {
const NavigationEntry* current_entry,
const NavigationEntryImpl* new_entry) const;
- // Returns an appropriate SiteInstance object for the given NavigationEntry,
+ // Returns an appropriate SiteInstance object for the given |dest_url|,
// possibly reusing the current SiteInstance. If --process-per-tab is used,
// this is only called when ShouldSwapBrowsingInstancesForNavigation returns
- // true.
- SiteInstance* GetSiteInstanceForEntry(
- const NavigationEntryImpl& entry,
+ // true. |dest_instance| will be used if it is not null.
+ SiteInstance* GetSiteInstanceForURL(
+ const GURL& dest_url,
+ SiteInstance* dest_instance,
+ PageTransition dest_transition,
+ bool dest_is_restore,
+ bool dest_is_view_source_mode,
SiteInstance* current_instance,
bool force_browsing_instance_swap);

Powered by Google App Engine
This is Rietveld 408576698