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

Unified Diff: content/browser/web_contents/render_view_host_manager.h

Issue 10690048: Clean up RenderViewHostManager swapping logic. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix merge conflict Created 8 years, 1 month 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/web_contents/render_view_host_manager.h
diff --git a/content/browser/web_contents/render_view_host_manager.h b/content/browser/web_contents/render_view_host_manager.h
index b77a125c9e5351e2483d26423c3016db46881972..442119e55c3e37f6610a2652801187fe1b605d58 100644
--- a/content/browser/web_contents/render_view_host_manager.h
+++ b/content/browser/web_contents/render_view_host_manager.h
@@ -232,26 +232,30 @@ class CONTENT_EXPORT RenderViewHostManager
// switch. Can be overridden in unit tests.
bool ShouldTransitionCrossSite();
- // Returns true if the two navigation entries are incompatible in some way
- // other than site instances. Cases where this can happen include Web UI
- // to regular web pages. It will cause us to swap RenderViewHosts (and hence
- // RenderProcessHosts) even if the site instance would otherwise be the same.
- // As part of this, we'll also force new SiteInstances and BrowsingInstances.
+ // 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.
- bool ShouldSwapProcessesForNavigation(
- const NavigationEntry* curr_entry,
+ bool ShouldSwapBrowsingInstanceForNavigation(
+ const NavigationEntry* current_entry,
const NavigationEntryImpl* new_entry) const;
+ // Returns true if it is safe to reuse the current WebUI when navigating from
+ // |curr_entry| to |new_entry|.
bool ShouldReuseWebUI(
const NavigationEntry* curr_entry,
const NavigationEntryImpl* new_entry) const;
// Returns an appropriate SiteInstance object for the given NavigationEntry,
- // possibly reusing the current SiteInstance.
- // Never called if --process-per-tab is used.
+ // possibly reusing the current SiteInstance. If --process-per-tab is used,
+ // this is only called when ShouldSwapBrowsingInstancesForNavigation returns
+ // true.
SiteInstance* GetSiteInstanceForEntry(
const NavigationEntryImpl& entry,
- SiteInstance* curr_instance);
+ SiteInstance* curr_instance,
+ bool force_swap);
// Sets up the necessary state for a new RenderViewHost with the given opener.
bool InitRenderView(RenderViewHost* render_view_host, int opener_route_id);
@@ -322,6 +326,6 @@ class CONTENT_EXPORT RenderViewHostManager
DISALLOW_COPY_AND_ASSIGN(RenderViewHostManager);
};
-} // namespace content
+} // namespace content
#endif // CONTENT_BROWSER_WEB_CONTENTS_RENDER_VIEW_HOST_MANAGER_H_
« no previous file with comments | « content/browser/debugger/devtools_manager_unittest.cc ('k') | content/browser/web_contents/render_view_host_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698