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

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

Issue 8138004: Fix issues related to <all_urls> in extensions. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: . Created 9 years, 2 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/common/extensions/extension_permission_set.cc
diff --git a/chrome/common/extensions/extension_permission_set.cc b/chrome/common/extensions/extension_permission_set.cc
index ee15ac8b3420f1779324a4e00d5ad93855092c1d..05550022fa656dff70a5dccdeb2d6b90832f6afe 100644
--- a/chrome/common/extensions/extension_permission_set.cc
+++ b/chrome/common/extensions/extension_permission_set.cc
@@ -747,15 +747,18 @@ std::set<std::string> ExtensionPermissionSet::GetDistinctHosts(
void ExtensionPermissionSet::InitEffectiveHosts() {
effective_hosts_.ClearPatterns();
+ URLPatternSet::CreateUnion(
+ explicit_hosts(), scriptable_hosts(), &effective_hosts_);
+
+ // When this has effective access to all hosts, compact the list of hosts
+ // to only contain <all_urls>.
if (HasEffectiveAccessToAllHosts()) {
URLPattern all_urls(URLPattern::SCHEME_ALL);
all_urls.SetMatchAllURLs(true);
+ effective_hosts_.ClearPatterns();
effective_hosts_.AddPattern(all_urls);
return;
}
-
- URLPatternSet::CreateUnion(
- explicit_hosts(), scriptable_hosts(), &effective_hosts_);
}
void ExtensionPermissionSet::InitImplicitExtensionPermissions(

Powered by Google App Engine
This is Rietveld 408576698