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

Unified Diff: chrome/browser/renderer_host/render_process_host.h

Issue 126002: Group renderer processes by privilige when we hit the max process count.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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: chrome/browser/renderer_host/render_process_host.h
===================================================================
--- chrome/browser/renderer_host/render_process_host.h (revision 18263)
+++ chrome/browser/renderer_host/render_process_host.h (working copy)
@@ -28,6 +28,16 @@
public:
typedef IDMap<RenderProcessHost>::const_iterator iterator;
+ // We classify renderers according to their highest privilege, and try
+ // to group pages into renderers with similar privileges.
+ // Note: it may be possible for a renderer to have multiple privileges,
+ // in which case we call it an "extension" renderer.
+ enum Type {
+ TYPE_NORMAL, // Normal renderer, no extra privileges.
+ TYPE_DOMUI, // Renderer with DOMUI privileges, like New Tab.
+ TYPE_EXTENSION, // Renderer with extension privileges.
+ };
+
RenderProcessHost(Profile* profile);
virtual ~RenderProcessHost();
@@ -174,15 +184,19 @@
static bool ShouldTryToUseExistingProcessHost();
// Get an existing RenderProcessHost associated with the given profile, if
- // possible. The renderer process is chosen randomly from the
- // processes associated with the given profile.
- // Returns NULL if no suitable renderer process is available.
- static RenderProcessHost* GetExistingProcessHost(Profile* profile);
+ // possible. The renderer process is chosen randomly from suitable renderers
+ // that share the same profile and type.
+ // Returns NULL if no suitable renderer process is available, in which case
+ // the caller is free to create a new renderer.
+ static RenderProcessHost* GetExistingProcessHost(Profile* profile, Type type);
protected:
- // Sets the process of this object, so that others access it using FromID.
+ // Sets the process of this object, so that others access it using FromID.
void SetProcessID(int pid);
+ // For testing. Removes this host from the list of hosts.
+ void RemoveFromList();
+
base::Process process_;
// A proxy for our IPC::Channel that lives on the IO thread (see
« no previous file with comments | « chrome/browser/renderer_host/mock_render_process_host.cc ('k') | chrome/browser/renderer_host/render_process_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698