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

Unified Diff: chrome/renderer/extensions/extension_dispatcher.cc

Issue 7347011: Update URLPatternSet to contain a std::set instead of std::vector. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix windows compile errors. Created 9 years, 5 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/common/extensions/user_script_unittest.cc ('k') | chrome/renderer/extensions/user_script_slave.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/extensions/extension_dispatcher.cc
diff --git a/chrome/renderer/extensions/extension_dispatcher.cc b/chrome/renderer/extensions/extension_dispatcher.cc
index e6546237c59557c861f4e1b0b6c9c2117eebb1ea..098e3e51cf984d2bee77188acdfc5ed996904839 100644
--- a/chrome/renderer/extensions/extension_dispatcher.cc
+++ b/chrome/renderer/extensions/extension_dispatcher.cc
@@ -243,9 +243,10 @@ void ExtensionDispatcher::InitHostPermissions(const Extension* extension) {
false);
}
- const URLPatternList& permissions =
- extension->permission_set()->explicit_hosts().patterns();
- for (size_t i = 0; i < permissions.size(); ++i) {
+ const URLPatternSet& permissions =
+ extension->permission_set()->explicit_hosts();
+ for (URLPatternSet::const_iterator i = permissions.begin();
+ i != permissions.end(); ++i) {
const char* schemes[] = {
chrome::kHttpScheme,
chrome::kHttpsScheme,
@@ -253,12 +254,12 @@ void ExtensionDispatcher::InitHostPermissions(const Extension* extension) {
chrome::kChromeUIScheme,
};
for (size_t j = 0; j < arraysize(schemes); ++j) {
- if (permissions[i].MatchesScheme(schemes[j])) {
+ if (i->MatchesScheme(schemes[j])) {
WebSecurityPolicy::addOriginAccessWhitelistEntry(
extension->url(),
WebString::fromUTF8(schemes[j]),
- WebString::fromUTF8(permissions[i].host()),
- permissions[i].match_subdomains());
+ WebString::fromUTF8(i->host()),
+ i->match_subdomains());
}
}
}
« no previous file with comments | « chrome/common/extensions/user_script_unittest.cc ('k') | chrome/renderer/extensions/user_script_slave.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698