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

Unified Diff: content/browser/site_instance_impl.h

Issue 1797363002: "Top Document Isolation" mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Suppress tests under --site-per-process 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
« no previous file with comments | « content/browser/renderer_host/render_process_host_impl.cc ('k') | content/browser/site_instance_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/site_instance_impl.h
diff --git a/content/browser/site_instance_impl.h b/content/browser/site_instance_impl.h
index 9fe82a9480a3ba70fe3492c9ad4e30d37022067b..935fc2982c2f685a9a05543f3e15db64b27a1746 100644
--- a/content/browser/site_instance_impl.h
+++ b/content/browser/site_instance_impl.h
@@ -50,6 +50,12 @@ class CONTENT_EXPORT SiteInstanceImpl : public SiteInstance,
size_t GetRelatedActiveContentsCount() override;
bool RequiresDedicatedProcess() override;
+ // Returns the SiteInstance, related to this one, that should be used
+ // for subframes when an oopif is required, but a dedicated process is not.
+ // This SiteInstance will be created if it doesn't already exist. There is
+ // at most one of these per BrowsingInstance.
+ scoped_refptr<SiteInstanceImpl> GetDefaultSubframeSiteInstance();
+
// Set the web site that this SiteInstance is rendering pages for.
// This includes the scheme and registered domain, but not the port. If the
// URL does not have a valid registered domain, then the full hostname is
@@ -94,6 +100,10 @@ class CONTENT_EXPORT SiteInstanceImpl : public SiteInstance,
void AddObserver(Observer* observer);
void RemoveObserver(Observer* observer);
+ bool is_default_subframe_site_instance() {
+ return is_default_subframe_site_instance_;
+ }
+
// Sets the global factory used to create new RenderProcessHosts. It may be
// NULL, in which case the default RenderProcessHost will be created (this is
// the behavior if you don't call this function). The factory must be set
@@ -130,6 +140,11 @@ class CONTENT_EXPORT SiteInstanceImpl : public SiteInstance,
// instead.
explicit SiteInstanceImpl(BrowsingInstance* browsing_instance);
+ // Only BrowsingInstance should call this.
+ void set_is_default_subframe_site_instance() {
+ is_default_subframe_site_instance_ = true;
+ }
+
private:
// RenderProcessHostObserver implementation.
void RenderProcessHostDestroyed(RenderProcessHost* host) override;
@@ -168,6 +183,11 @@ class CONTENT_EXPORT SiteInstanceImpl : public SiteInstance,
// Whether SetSite has been called.
bool has_site_;
+ // Whether this SiteInstance is the default subframe SiteInstance for its
+ // BrowsingInstance. Only one SiteInstance per BrowsingInstance can have this
+ // be true.
+ bool is_default_subframe_site_instance_;
+
base::ObserverList<Observer, true> observers_;
DISALLOW_COPY_AND_ASSIGN(SiteInstanceImpl);
« no previous file with comments | « content/browser/renderer_host/render_process_host_impl.cc ('k') | content/browser/site_instance_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698