summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrockot@chromium.org <rockot@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-26 00:34:35 +0000
committerrockot@chromium.org <rockot@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-26 00:34:35 +0000
commitaf26e9f63a199f96d23cd0b70a0f4edcf9570ea8 (patch)
treecbf577978e198fc04fa0e9d9eebd31cc6f5ba8d5
parentd4bdae3dfd116915c262cce6cfaecb445e3108d5 (diff)
downloadchromium_src-af26e9f63a199f96d23cd0b70a0f4edcf9570ea8.zip
chromium_src-af26e9f63a199f96d23cd0b70a0f4edcf9570ea8.tar.gz
chromium_src-af26e9f63a199f96d23cd0b70a0f4edcf9570ea8.tar.bz2
app_shell: Enable process-per-site
This ensures that all render frames created for a single app will use the same render process. BUG=346410 R=jamescook@chromium.org Review URL: https://codereview.chromium.org/180243003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@253305 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--apps/shell/browser/shell_content_browser_client.cc10
-rw-r--r--apps/shell/browser/shell_content_browser_client.h2
2 files changed, 12 insertions, 0 deletions
diff --git a/apps/shell/browser/shell_content_browser_client.cc b/apps/shell/browser/shell_content_browser_client.cc
index 332aee2..8d2983c 100644
--- a/apps/shell/browser/shell_content_browser_client.cc
+++ b/apps/shell/browser/shell_content_browser_client.cc
@@ -50,6 +50,16 @@ void ShellContentBrowserClient::RenderProcessWillLaunch(
render_process_id, browser_main_parts_->browser_context()));
}
+bool ShellContentBrowserClient::ShouldUseProcessPerSite(
+ content::BrowserContext* browser_context,
+ const GURL& effective_url) {
+ // This ensures that all render views created for a single app will use the
+ // same render process (see content::SiteInstance::GetProcess). Otherwise the
+ // default behavior of ContentBrowserClient will lead to separate render
+ // processes for the background page and each app window view.
+ return true;
+}
+
net::URLRequestContextGetter*
ShellContentBrowserClient::CreateRequestContext(
content::BrowserContext* content_browser_context,
diff --git a/apps/shell/browser/shell_content_browser_client.h b/apps/shell/browser/shell_content_browser_client.h
index e3dc619..14c1ed8 100644
--- a/apps/shell/browser/shell_content_browser_client.h
+++ b/apps/shell/browser/shell_content_browser_client.h
@@ -28,6 +28,8 @@ class ShellContentBrowserClient : public content::ContentBrowserClient {
const content::MainFunctionParams& parameters) OVERRIDE;
virtual void RenderProcessWillLaunch(
content::RenderProcessHost* host) OVERRIDE;
+ virtual bool ShouldUseProcessPerSite(content::BrowserContext* browser_context,
+ const GURL& effective_url) OVERRIDE;
virtual net::URLRequestContextGetter* CreateRequestContext(
content::BrowserContext* browser_context,
content::ProtocolHandlerMap* protocol_handlers) OVERRIDE;