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

Unified Diff: content/browser/site_instance.cc

Issue 8033001: Delegate decision what site instances can be rendered in what process to chrome (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates Created 9 years, 3 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.cc
diff --git a/content/browser/site_instance.cc b/content/browser/site_instance.cc
index cd68b7b027140532d9d195ac4be1ffd6bd015745..3f7f82785bb02ef99afd5dc820034fed73e582ac 100644
--- a/content/browser/site_instance.cc
+++ b/content/browser/site_instance.cc
@@ -71,7 +71,7 @@ RenderProcessHost* SiteInstance::GetProcess() {
// See if we should reuse an old process
if (RenderProcessHost::ShouldTryToUseExistingProcessHost())
process_ = RenderProcessHost::GetExistingProcessHost(
- browsing_instance_->browser_context(), GetRendererType());
+ browsing_instance_->browser_context(), site_);
// Otherwise (or if that fails), create a new one.
if (!process_) {
@@ -129,7 +129,9 @@ bool SiteInstance::HasWrongProcessForURL(const GURL& url) const {
// process is not (or vice versa), make sure we notice and fix it.
GURL effective_url = GetEffectiveURL(browsing_instance_->browser_context(),
url);
- return effective_url.SchemeIs(chrome::kExtensionScheme) !=
+ content::ContentBrowserClient* browser =
+ content::GetContentClient()->browser();
+ return browser->ShouldRunInPrivilegedProcess(effective_url) !=
process_->is_extension_process();
jam 2011/09/26 16:28:15 note: it's not just kExtensionScheme that we don't
}
@@ -220,30 +222,6 @@ GURL SiteInstance::GetEffectiveURL(content::BrowserContext* browser_context,
GetEffectiveURL(browser_context, url);
}
-/*static*/
-RenderProcessHost::Type SiteInstance::RendererTypeForURL(const GURL& url) {
- if (!url.is_valid())
- return RenderProcessHost::TYPE_NORMAL;
-
- if (url.SchemeIs(chrome::kExtensionScheme))
- return RenderProcessHost::TYPE_EXTENSION;
-
- // TODO(erikkay) creis recommends using UseWebUIForURL instead.
- if (content::WebUIFactory::Get()->HasWebUIScheme(url))
- return RenderProcessHost::TYPE_WEBUI;
-
- return RenderProcessHost::TYPE_NORMAL;
-}
-
-RenderProcessHost::Type SiteInstance::GetRendererType() {
- // We may not have a site at this point, which generally means this is a
- // normal navigation.
- if (!has_site_)
- return RenderProcessHost::TYPE_NORMAL;
-
- return RendererTypeForURL(site_);
-}
-
void SiteInstance::Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) {

Powered by Google App Engine
This is Rietveld 408576698