This page details the BrowsingInstance
class and its role in site isolation.
A BrowsingInstance
represents a group of SiteInstance
s that share the same browsing context. It is a key component in managing the relationships between different sites and processes. Each BrowsingInstance
is associated with a CoopRelatedGroup
, which determines which pages can communicate with each other via same-origin scripting.
- Incorrectly managing
BrowsingInstance
s can lead to inconsistent isolation decisions across tabs and windows. - Errors in determining which
SiteInstance
s belong to the sameBrowsingInstance
can lead to security vulnerabilities.
content/browser/browsing_instance.h
content/browser/browsing_instance.cc
BrowsingInstance()
: Constructor for creating a newBrowsingInstance
. It takes the following parameters:context
: TheBrowserContext
to which thisBrowsingInstance
belongs.web_exposed_isolation_info
: Indicates whether theBrowsingInstance
should contain only cross-origin isolated pages.is_guest
: Specifies whether thisBrowsingInstance
will be used in a<webview>
guest.is_fenced
: Specifies whether thisBrowsingInstance
is used inside a fenced frame.is_fixed_storage_partition
: Indicates whether the currentStoragePartition
will apply to future navigations.coop_related_group
: TheCoopRelatedGroup
to which thisBrowsingInstance
belongs.common_coop_origin
: If set, indicates that all documents hosted by theBrowsingInstance
have the same COOP value defined by the given origin.
~BrowsingInstance()
: Destructor for theBrowsingInstance
. It removes any origin isolation opt-ins associated with this instance.GetBrowserContext()
: Returns the associatedBrowserContext
.isolation_context()
: Returns theIsolationContext
associated with thisBrowsingInstance
.is_fixed_storage_partition()
: Returns true if theStoragePartition
should be preserved across future navigations.site_instance_group_manager()
: Returns theSiteInstanceGroupManager
that controls theSiteInstanceGroup
s associated with thisBrowsingInstance
.HasSiteInstance()
: Checks if aSiteInstance
exists for a givenSiteInfo
.GetSiteInstanceForURL()
: Gets or creates aSiteInstance
for a given URL.GetSiteInstanceForSiteInfo()
: Gets or creates aSiteInstance
for a givenSiteInfo
.GetMaybeGroupRelatedSiteInstanceForURL()
: Gets aSiteInstance
in the sameSiteInstanceGroup
.GetCoopRelatedSiteInstanceForURL()
: Gets aSiteInstance
in the sameCoopRelatedGroup
.GetSiteInfoForURL()
: Gets theSiteInfo
for a given URL.GetSiteInstanceForURLHelper()
: Helper forGetSiteInstanceForURL
andGetSiteInfoForURL
.RegisterSiteInstance()
: Registers aSiteInstance
with theBrowsingInstance
.UnregisterSiteInstance()
: Unregisters aSiteInstance
.coop_related_group_token()
: Returns the token uniquely identifying theCoopRelatedGroup
thisBrowsingInstance
belongs to.token()
: Returns the unique token for thisBrowsingInstance
.GetCoopRelatedGroupActiveContentsCount()
: Returns the number of active contents in theCoopRelatedGroup
.IncrementActiveContentsCount()
: Increments the active contents count.DecrementActiveContentsCount()
: Decrements the active contents count.HasDefaultSiteInstance()
: Checks if a defaultSiteInstance
exists.ComputeSiteInfoForURL()
: Computes theSiteInfo
for a given URL.EstimateOriginAgentClusterOverhead()
: Estimates overhead due to origin-keyed processes.web_exposed_isolation_info()
: Returns the web-exposed isolation status.default_site_instance()
: Returns the defaultSiteInstance
.common_coop_origin()
: Returns the common COOP origin.NextBrowsingInstanceId()
: Returns the ID for the nextBrowsingInstance
to be created.
next_browsing_instance_id_
: Static variable tracking the next availableBrowsingInstance
ID.isolation_context_
: Stores theIsolationContext
associated with thisBrowsingInstance
.site_instance_group_manager_
: ManagesSiteInstanceGroup
objects for thisBrowsingInstance
.active_contents_count_
: Tracks the number of active contents in thisBrowsingInstance
.default_site_instance_
: Stores the defaultSiteInstance
used for sites that don't require dedicated processes.web_exposed_isolation_info_
: Stores the web-exposed isolation status of thisBrowsingInstance
.storage_partition_config_
: Stores theStoragePartitionConfig
that must be used by allSiteInstance
s in thisBrowsingInstance
.coop_related_group_
: Stores a reference to the associatedCoopRelatedGroup
.common_coop_origin_
: If set, indicates that all documents in thisBrowsingInstance
share the same COOP value defined by the given origin.is_fixed_storage_partition_
: Indicates whether theStoragePartition
should be preserved across future navigations.token_
: Stores the unique token for thisBrowsingInstance
.site_instance_map_
: A map ofSiteInfo
toSiteInstanceImpl
, ensuring only oneSiteInstance
per site within theBrowsingInstance
.
- The logic for determining which
SiteInstance
s belong to the sameBrowsingInstance
. - The interaction between
BrowsingInstance
,SiteInstance
, andSiteInstanceGroup
in managing processes and enforcing site isolation. - The impact of incorrect
BrowsingInstance
management on cross-origin communication and data access. - The role of
CoopRelatedGroup
in managing communication betweenBrowsingInstance
s. - The implications of the
web_exposed_isolation_info_
andcommon_coop_origin_
on site isolation and process allocation. - The usage of
default_site_instance_
and its impact on security and performance. - How
BrowsingInstance
management interacts with features like<webview>
, fenced frames, and service workers. - The relationship between
BrowsingInstance
and the renderer-sideblink::Page::RelatedPages()
method.
chromiumwiki/README.md
content/browser/url_info.cc
chromiumwiki/url_info.md
content/browser/url_info.h
content/browser/site_info.cc
chromiumwiki/site_info.md
content/browser/site_info.h
content/browser/site_instance_impl.cc
chromiumwiki/site_instance.md
content/browser/site_instance_impl.h
content/browser/site_instance_group.cc
chromiumwiki/site_instance_group.md
content/browser/site_instance_group.h
content/browser/site_instance_group_manager.cc
content/browser/browsing_instance.h
content/browser/browsing_instance.cc