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

Unified Diff: chrome/browser/chrome_content_browser_client.cc

Issue 9508008: Allow apps with background pages to request process-per-app-instance. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 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 | « no previous file | chrome/browser/extensions/app_process_apitest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 5a898a9a27de3fdaa886864d8837ee019cecb781..0df97061750677d6dfca81f9937c4fc03b254a4d 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -450,15 +450,19 @@ bool ChromeContentBrowserClient::ShouldUseProcessPerSite(
return false;
// If the URL is part of a hosted app that does not have the background
- // permission, we want to give each instance its own process to improve
+ // permission, or that does not allow JavaScript access to the background
+ // page, we want to give each instance its own process to improve
// responsiveness.
- if (extension->GetType() == Extension::TYPE_HOSTED_APP &&
- !extension->HasAPIPermission(ExtensionAPIPermission::kBackground))
- return false;
+ if (extension->GetType() == Extension::TYPE_HOSTED_APP) {
+ if (!extension->HasAPIPermission(ExtensionAPIPermission::kBackground) ||
+ !extension->allow_background_js_access()) {
Charlie Reis 2012/02/29 02:56:32 Drew or Mihai, is there a way to enforce having no
Andrew T Wilson (Slow) 2012/02/29 03:20:15 I think returning false from CanCreateWindow() wil
Charlie Reis 2012/03/01 00:38:22 Yep, seems to work.
+ return false;
+ }
+ }
- // Hosted apps that have the background permission must use process per site,
- // since all instances can make synchronous calls to the background window.
- // Other extensions should use process per site as well.
+ // Hosted apps that have script access to their background page must use
+ // process per site, since all instances can make synchronous calls to the
+ // background window. Other extensions should use process per site as well.
return true;
}
« no previous file with comments | « no previous file | chrome/browser/extensions/app_process_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698