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

Unified Diff: content/browser/site_instance_impl.h

Issue 2861433002: Implement ProcessReusePolicy for SiteInstances (Closed)
Patch Set: Rebase Created 3 years, 8 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/site_instance_impl.h
diff --git a/content/browser/site_instance_impl.h b/content/browser/site_instance_impl.h
index fc2ad85bd30738cf2167cc2bd8735aeebe7ced99..2e03203f26e7026dda5f77e2157a3b6753dd8958 100644
--- a/content/browser/site_instance_impl.h
+++ b/content/browser/site_instance_impl.h
@@ -51,6 +51,14 @@ class CONTENT_EXPORT SiteInstanceImpl final : public SiteInstance,
bool RequiresDedicatedProcess() override;
bool IsDefaultSubframeSiteInstance() const override;
+ void set_process_reuse_policy(
+ RenderProcessHostImpl::ProcessReusePolicy policy) {
+ process_reuse_policy_ = policy;
+ }
+ RenderProcessHostImpl::ProcessReusePolicy process_reuse_policy() const {
+ return process_reuse_policy_;
+ }
+
// 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
@@ -101,13 +109,6 @@ class CONTENT_EXPORT SiteInstanceImpl final : public SiteInstance,
void AddObserver(Observer* observer);
void RemoveObserver(Observer* observer);
- // 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
- // back to NULL before it's destroyed; ownership is not transferred.
- static void set_render_process_host_factory(
- const RenderProcessHostFactory* rph_factory);
-
// Get the effective URL for the given actual URL. This allows the
// ContentBrowserClient to override the SiteInstance's site for certain URLs.
// For example, Chrome uses this to replace hosted app URLs with extension
@@ -149,10 +150,6 @@ class CONTENT_EXPORT SiteInstanceImpl final : public SiteInstance,
BrowserContext* browser_context,
bool is_for_guests_only);
- void set_is_default_subframe_site_instance() {
- is_default_subframe_site_instance_ = true;
- }
-
// An object used to construct RenderProcessHosts.
static const RenderProcessHostFactory* g_render_process_host_factory_;
@@ -180,10 +177,9 @@ class CONTENT_EXPORT SiteInstanceImpl final : 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_;
+ // The ProcessReusePolicy to use when creating a RenderProcessHost for this
+ // SiteInstance.
+ RenderProcessHostImpl::ProcessReusePolicy process_reuse_policy_;
base::ObserverList<Observer, true> observers_;

Powered by Google App Engine
This is Rietveld 408576698