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

Unified Diff: chrome/browser/chrome_content_browser_client.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: chrome/browser/chrome_content_browser_client.cc
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index bae8e9fb5dfe0b0695bf72bedcd0743ef6b83b6e..1b331d2f6a8d337276bf83021f95781cf4780521 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -247,6 +247,25 @@ bool ChromeContentBrowserClient::IsURLSameAsAnySiteInstance(const GURL& url) {
url == GURL(chrome::kChromeUIShorthangURL);
}
+bool ChromeContentBrowserClient::ShouldRunInPrivilegedProcess(const GURL& url) {
+ return url.SchemeIs(chrome::kExtensionScheme);
+}
+
+bool ChromeContentBrowserClient::IsSuitableHost(
+ RenderProcessHost* process_host,
+ const GURL& site_url) {
+ Profile* profile =
+ Profile::FromBrowserContext(process_host->browser_context());
+ ExtensionProcessManager* process_manager =
+ profile->GetExtensionProcessManager();
+ CHECK(process_manager);
+
+ bool is_extension_host =
+ process_host->is_extension_process() ||
+ process_manager->IsProcessHostWithBindings(process_host->id());
+ return site_url.SchemeIs(chrome::kExtensionScheme) == is_extension_host;
+}
+
std::string ChromeContentBrowserClient::GetCanonicalEncodingNameByAliasName(
const std::string& alias_name) {
return CharacterEncoding::GetCanonicalEncodingNameByAliasName(alias_name);

Powered by Google App Engine
This is Rietveld 408576698