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

Unified Diff: extensions/browser/api/web_request/web_request_api.cc

Issue 1330263002: Show hosted app requests to extensions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2490
Patch Set: Created 5 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 | « chrome/test/data/extensions/api_test/webrequest_hosted_app/manifest.json ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/api/web_request/web_request_api.cc
diff --git a/extensions/browser/api/web_request/web_request_api.cc b/extensions/browser/api/web_request/web_request_api.cc
index 0aaa4fad49fdd99661c424b454038001ed5c9ec3..032108eab4f52620dfd524ba4bdfd54ac897e76a 100644
--- a/extensions/browser/api/web_request/web_request_api.cc
+++ b/extensions/browser/api/web_request/web_request_api.cc
@@ -159,7 +159,20 @@ bool IsRequestFromExtension(const net::URLRequest* request,
if (!info)
return false;
- return extension_info_map->process_map().Contains(info->GetChildID());
+ const std::set<std::string> extension_ids =
+ extension_info_map->process_map().GetExtensionsInProcess(
+ info->GetChildID());
+ if (extension_ids.empty())
+ return false;
+
+ // Treat hosted apps as normal web pages (crbug.com/526413).
+ for (const std::string& extension_id : extension_ids) {
+ const Extension* extension =
+ extension_info_map->extensions().GetByID(extension_id);
+ if (extension && !extension->is_hosted_app())
+ return true;
+ }
+ return false;
}
void ExtractRequestRoutingInfo(const net::URLRequest* request,
« no previous file with comments | « chrome/test/data/extensions/api_test/webrequest_hosted_app/manifest.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698