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

Unified Diff: chrome/browser/extensions/chrome_content_browser_client_extensions_part.cc

Issue 2803963002: Don't kill Chrome Apps that make XHRs from guests. (Closed)
Patch Set: Fix nits. Created 3 years, 8 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/extensions/chrome_content_browser_client_extensions_part.cc
diff --git a/chrome/browser/extensions/chrome_content_browser_client_extensions_part.cc b/chrome/browser/extensions/chrome_content_browser_client_extensions_part.cc
index 6bf45963aa2b568c9e7217d0440f37e4599cdb8b..8501851e179dc7bd5db7e772c7504f983b480279 100644
--- a/chrome/browser/extensions/chrome_content_browser_client_extensions_part.cc
+++ b/chrome/browser/extensions/chrome_content_browser_client_extensions_part.cc
@@ -202,15 +202,17 @@ content::HeaderInterceptorResult CheckOriginHeader(
return content::HeaderInterceptorResult::FAIL;
// Check for platform app origins. These can only be committed by the app
- // itself, or by one if its guests if there are accessible_resources.
+ // itself, or by one if its guests if it has the webview permission.
// Processes that incorrectly claim to be an app should be killed.
const ProcessMap& process_map = extension_info_map->process_map();
if (extension->is_platform_app() &&
!process_map.Contains(extension->id(), child_id)) {
- // This is a platform app origin not in the app's own process. If there
- // are no accessible resources, this is illegal.
- if (!extension->GetManifestData(manifest_keys::kWebviewAccessibleResources))
+ // This is a platform app origin not in the app's own process. If it cannot
+ // create webviews, this is illegal.
+ if (!extension->permissions_data()->HasAPIPermission(
+ extensions::APIPermission::kWebView)) {
return content::HeaderInterceptorResult::KILL;
+ }
// If there are accessible resources, the origin is only legal if the
// given process is a guest of the app.

Powered by Google App Engine
This is Rietveld 408576698