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

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
« no previous file with comments | « content/browser/site_instance.h ('k') | content/browser/site_instance_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/site_instance.cc
diff --git a/content/browser/site_instance.cc b/content/browser/site_instance.cc
index cd68b7b027140532d9d195ac4be1ffd6bd015745..44a9f2e5d5b4296ff7666abd09a783a7e80807dc 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_) {
@@ -125,12 +125,12 @@ bool SiteInstance::HasWrongProcessForURL(const GURL& url) const {
if (!HasProcess())
return false;
- // If the effective URL is an extension (e.g., for hosted apps) but the
+ // If the site URL is an extension (e.g., for hosted apps) but the
// 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) !=
- process_->is_extension_process();
+ GURL site_url = GetSiteForURL(browsing_instance_->browser_context(), url);
+ content::ContentBrowserClient* browser =
+ content::GetContentClient()->browser();
+ return !browser->IsSuitableHost(process_, site_url);
}
/*static*/
@@ -220,30 +220,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) {
« no previous file with comments | « content/browser/site_instance.h ('k') | content/browser/site_instance_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698