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

Unified Diff: chrome/browser/tab_contents/site_instance.cc

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
« no previous file with comments | « chrome/browser/tab_contents/site_instance.h ('k') | chrome/browser/tab_contents/site_instance_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/tab_contents/site_instance.cc
===================================================================
--- chrome/browser/tab_contents/site_instance.cc (revision 18263)
+++ chrome/browser/tab_contents/site_instance.cc (working copy)
@@ -4,6 +4,7 @@
#include "chrome/browser/tab_contents/site_instance.h"
+#include "chrome/browser/dom_ui/dom_ui_factory.h"
#include "chrome/browser/renderer_host/browser_render_process_host.h"
#include "chrome/common/url_constants.h"
#include "chrome/common/notification_service.h"
@@ -35,7 +36,7 @@
// See if we should reuse an old process
if (RenderProcessHost::ShouldTryToUseExistingProcessHost())
process_ = RenderProcessHost::GetExistingProcessHost(
- browsing_instance_->profile());
+ browsing_instance_->profile(), GetRendererType());
// Otherwise (or if that fails), create a new one.
if (!process_) {
@@ -166,6 +167,21 @@
return net::RegistryControlledDomainService::SameDomainOrHost(url1, url2);
}
+RenderProcessHost::Type SiteInstance::GetRendererType() {
+ // We may not have a site at this point, which generally means this is a
+ // normal navigation.
+ if (!has_site_ || !site_.is_valid())
+ return RenderProcessHost::TYPE_NORMAL;
+
+ if (site_.SchemeIs(chrome::kExtensionScheme))
+ return RenderProcessHost::TYPE_EXTENSION;
+
+ if (DOMUIFactory::HasDOMUIScheme(site_))
+ return RenderProcessHost::TYPE_DOMUI;
+
+ return RenderProcessHost::TYPE_NORMAL;
+}
+
void SiteInstance::Observe(NotificationType type,
const NotificationSource& source,
const NotificationDetails& details) {
« no previous file with comments | « chrome/browser/tab_contents/site_instance.h ('k') | chrome/browser/tab_contents/site_instance_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698