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

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

Issue 1797363002: "Top Document Isolation" mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix up tests. Necessary rebase to obtain browsertest util behavior change. Created 4 years, 9 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 c758e8a3480828fc5fd35a95c8b5b55b0d1f6c79..4933b72b89ea877460e728b4ba275a20a6bcfe63 100644
--- a/content/browser/frame_host/render_frame_host_manager.h
+++ b/content/browser/frame_host/render_frame_host_manager.h
@@ -506,6 +506,15 @@ class CONTENT_EXPORT RenderFrameHostManager
friend class RenderFrameHostManagerTest;
friend class TestWebContents;
+ enum class SiteInstanceRelation {
+ // A SiteInstance in a different browsing instance from the current.
+ UNRELATED,
+ // A SiteInstance in the same browsing instance as the current.
+ RELATED,
+ // The default subframe SiteInstance for the current browsing instance.
+ RELATED_DEFAULT_SUBFRAME,
+ };
+
// Stores information regarding a SiteInstance targeted at a specific URL to
// allow for comparisons without having to actually create new instances. It
// can point to an existing one or store the details needed to create a new
@@ -513,11 +522,11 @@ class CONTENT_EXPORT RenderFrameHostManager
struct CONTENT_EXPORT SiteInstanceDescriptor {
explicit SiteInstanceDescriptor(content::SiteInstance* site_instance)
: existing_site_instance(site_instance),
- new_is_related_to_current(false) {}
+ relation(SiteInstanceRelation::UNRELATED) {}
SiteInstanceDescriptor(BrowserContext* browser_context,
GURL dest_url,
- bool related_to_current);
+ SiteInstanceRelation relation_to_current);
// Set with an existing SiteInstance to be reused.
content::SiteInstance* existing_site_instance;
@@ -525,9 +534,9 @@ class CONTENT_EXPORT RenderFrameHostManager
// In case |existing_site_instance| is null, specify a new site URL.
GURL new_site_url;
- // In case |existing_site_instance| is null, specify if the new site should
- // be created in a new BrowsingInstance or not.
- bool new_is_related_to_current;
+ // In case |existing_site_instance| is null, specify how the new site is
+ // related to the current BrowsingInstance.
+ SiteInstanceRelation relation;
};
// Create a RenderFrameProxyHost owned by this object.
@@ -600,9 +609,9 @@ class CONTENT_EXPORT RenderFrameHostManager
SiteInstance* ConvertToSiteInstance(const SiteInstanceDescriptor& descriptor,
SiteInstance* candidate_instance);
- // Determines the appropriate url to use as the current url for SiteInstance
- // selection.
- const GURL& GetCurrentURLForSiteInstance(SiteInstance* current_instance);
+ // Returns true if |candidate| is currently on the same web site as dest_url.
+ bool IsCurrentlySameSite(RenderFrameHostImpl* candidate,
+ const GURL& dest_url);
// Creates a new RenderFrameHostImpl for the |new_instance| and assign it to
// |pending_render_frame_host_| while respecting the opener route if needed

Powered by Google App Engine
This is Rietveld 408576698