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

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

Issue 10575014: Move process-per-site logic from BrowsingInstance to RenderProcessHost. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Clean up RPHs in test. Created 8 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
Index: content/public/browser/render_process_host.h
diff --git a/content/public/browser/render_process_host.h b/content/public/browser/render_process_host.h
index 7f5e3b7e7a60e024b9788b8bacb4d0e5ab0afc12..675b76aaf77f1b8d9ea65c58f8e4a4776379deb5 100644
--- a/content/public/browser/render_process_host.h
+++ b/content/public/browser/render_process_host.h
@@ -231,6 +231,32 @@ class CONTENT_EXPORT RenderProcessHost : public IPC::Sender,
static RenderProcessHost* GetExistingProcessHost(
content::BrowserContext* browser_context, const GURL& site_url);
+ // Returns whether the process-per-site model is in use (globally or just for
+ // the current site), in which case we should ensure there is only one
+ // RenderProcessHost per site for the entire browser context.
+ static bool ShouldUseProcessPerSite(content::BrowserContext* browser_context,
+ const GURL& url);
+
+ // Returns an existing RenderProcessHost for |url| in |browser_context|,
+ // if one exists. Otherwise a new RenderProcessHost should be created and
+ // registered using RegisterProcessHostForSite.
awong 2012/06/27 00:26:54 RegisterProcessHostForSite -> RegisterProcessHostF
Charlie Reis 2012/06/27 20:53:43 Done.
+ // This should only be used for process-per-site mode, which can be enabled
+ // globally with a command line flag or per-site, as determined by
+ // SiteInstanceImpl::ShouldUseProcessPerSite.
+ static RenderProcessHost* GetProcessHostForSite(
+ content::BrowserContext* browser_context,
+ const GURL& url);
+
+ // Registers the given |process| to be used for any instance of |url|
+ // within |browser_context|.
+ // This should only be used for process-per-site mode, which can be enabled
+ // globally with a command line flag or per-site, as determined by
+ // SiteInstanceImpl::ShouldUseProcessPerSite.
+ static void RegisterProcessHostForSite(
+ content::BrowserContext* browser_context,
+ RenderProcessHost* process,
+ const GURL& url);
+
// Overrides the default heuristic for limiting the max renderer process
// count. This is useful for unit testing process limit behaviors. It is
// also used to allow a command line parameter to configure the max number of

Powered by Google App Engine
This is Rietveld 408576698