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

Unified Diff: content/public/browser/site_instance.h

Issue 2101293003: Clarify that SiteInstance::GetSiteURL is usually not accurate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/browser/site_instance.h
diff --git a/content/public/browser/site_instance.h b/content/public/browser/site_instance.h
index 1ab1b5c3c03bab48a4aea0b6c69b9dd17d885f98..708da824c2951d4ccfd64de1e7c9410b77fe9a98 100644
--- a/content/public/browser/site_instance.h
+++ b/content/public/browser/site_instance.h
@@ -43,7 +43,8 @@ class RenderProcessHost;
// (which uses the same BrowsingInstance). If the user navigates within a site,
// the same SiteInstance is used. Caveat: we currently allow renderer-initiated
// cross-site navigations to stay in the same SiteInstance, to preserve
-// compatibility in cases like cross-site iframes that open popups.
+// compatibility in cases like cross-site iframes that open popups. This means
+// that most SiteInstances will contain pages from multiple sites.
//
// SITE PER PROCESS (currently experimental): is the most granular process
// model and is made possible by our support for out-of-process iframes. A
@@ -61,7 +62,9 @@ class RenderProcessHost;
//
// PROCESS PER SITE: We consolidate all SiteInstances for a given site into the
// same process, throughout the entire browser context. This ensures that only
-// one process will be used for each site.
+// one process will be used for each site. Note that there is no strict process
+// isolation of sites in this mode, so a given SiteInstance can still contain
+// pages from multiple sites.
//
// Each NavigationEntry for a WebContents points to the SiteInstance that
// rendered it. Each RenderFrameHost also points to the SiteInstance that it is
@@ -84,12 +87,12 @@ class CONTENT_EXPORT SiteInstance : public base::RefCounted<SiteInstance> {
// Returns the current RenderProcessHost being used to render pages for this
// SiteInstance. If there is no RenderProcessHost (because either none has
// yet been created or there was one but it was cleanly destroyed (e.g. when
- // it is not actively being used)), then this method will create a new
+ // it is not actively being used), then this method will create a new
// RenderProcessHost (and a new ID). Note that renderer process crashes leave
// the current RenderProcessHost (and ID) in place.
//
// For sites that require process-per-site mode (e.g., WebUI), this will
- // ensure only one RenderProcessHost for the site exists/ within the
+ // ensure only one RenderProcessHost for the site exists within the
// BrowserContext.
virtual content::RenderProcessHost* GetProcess() = 0;
@@ -97,8 +100,14 @@ class CONTENT_EXPORT SiteInstance : public base::RefCounted<SiteInstance> {
// SiteInstances) belongs.
virtual content::BrowserContext* GetBrowserContext() const = 0;
- // Get the web site that this SiteInstance is rendering pages for.
- // This includes the scheme and registered domain, but not the port.
+ // Get the web site that this SiteInstance is rendering pages for. This
+ // includes the scheme and registered domain, but not the port.
+ //
+ // NOTE: In most cases, this value should not be considered authoritative
+ // because a SiteInstance can usually host pages from multiple sites. It is
+ // only an accurate representation of the pages within the SiteInstance in
+ // the "site per process" process model, or for sites that require process
+ // isolation (e.g., WebUI, extensions).
virtual const GURL& GetSiteURL() const = 0;
// Gets a SiteInstance for the given URL that shares the current
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698