diff options
author | jstritar@chromium.org <jstritar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-13 15:03:47 +0000 |
---|---|---|
committer | jstritar@chromium.org <jstritar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-13 15:03:47 +0000 |
commit | 06e8b8ff0c9313a90243012961601ab63e89de1e (patch) | |
tree | 551c4198944f30c223acd905a0ba5874ff6f810f /chrome/browser/extensions/crx_installer.cc | |
parent | 613ccd6ad9e76e63dd76a579ed3a6b04fb13025b (diff) | |
download | chromium_src-06e8b8ff0c9313a90243012961601ab63e89de1e.zip chromium_src-06e8b8ff0c9313a90243012961601ab63e89de1e.tar.gz chromium_src-06e8b8ff0c9313a90243012961601ab63e89de1e.tar.bz2 |
Update URLPatternSet to contain a std::set instead of std::vector.
This updates URLPatternSet to contain a std::set instead of a std::vector, making it easier to implement the set operations in ExtensionPermissionSet.
BUG=84507
TEST=unit_tests
Review URL: http://codereview.chromium.org/7347011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92364 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/crx_installer.cc')
-rw-r--r-- | chrome/browser/extensions/crx_installer.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/chrome/browser/extensions/crx_installer.cc b/chrome/browser/extensions/crx_installer.cc index 2c6042f..a1b672c 100644 --- a/chrome/browser/extensions/crx_installer.cc +++ b/chrome/browser/extensions/crx_installer.cc @@ -283,12 +283,13 @@ bool CrxInstaller::AllowInstall(const Extension* extension, // host (or a subdomain of the host) the download happened from. There's // no way for us to verify that the app controls any other hosts. URLPattern pattern(UserScript::kValidUserScriptSchemes); - pattern.set_host(original_url_.host()); - pattern.set_match_subdomains(true); + pattern.SetHost(original_url_.host()); + pattern.SetMatchSubdomains(true); - URLPatternList patterns = extension_->web_extent().patterns(); - for (size_t i = 0; i < patterns.size(); ++i) { - if (!pattern.MatchesHost(patterns[i].host())) { + URLPatternSet patterns = extension_->web_extent(); + for (URLPatternSet::const_iterator i = patterns.begin(); + i != patterns.end(); ++i) { + if (!pattern.MatchesHost(i->host())) { *error = base::StringPrintf( "Apps must be served from the host that they affect."); return false; |