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

Unified Diff: chrome/common/extensions/extension.cc

Issue 10213002: Make downloads.download() respect host permissions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: " Created 8 years, 7 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/browser/download/download_extension_api.cc ('k') | chrome/common/extensions/extension_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/extension.cc
diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc
index 899720410f8a9ce238839b1ae0e51ba74107c200..238352d5dc936a89c96edcbb05277ba7c20f8618 100644
--- a/chrome/common/extensions/extension.cc
+++ b/chrome/common/extensions/extension.cc
@@ -3231,6 +3231,17 @@ bool Extension::HasHostPermission(const GURL& url) const {
location() != Extension::COMPONENT) {
return false;
}
+ if (url.SchemeIs(chrome::kExtensionScheme) &&
Aaron Boodman 2012/05/09 05:32:38 I think you can replace this entire new hunk with:
Aaron Boodman 2012/05/09 18:28:44 If this check were not here, are there multiple pl
benjhayden 2012/05/09 21:36:42 download() is the only function that will accept a
+ url.host() == id()) {
+ return true;
+ }
+ if (url.inner_url() != NULL &&
+ url.inner_url()->is_valid() &&
+ url.SchemeIsFileSystem() &&
+ url.inner_url()->SchemeIs(chrome::kExtensionScheme) &&
+ url.inner_url()->host() == id()) {
+ return true;
+ }
base::AutoLock auto_lock(runtime_data_lock_);
return runtime_data_.GetActivePermissions()->
« no previous file with comments | « chrome/browser/download/download_extension_api.cc ('k') | chrome/common/extensions/extension_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698