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

Unified Diff: chrome/browser/extensions/crx_installer.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
Index: chrome/browser/extensions/crx_installer.cc
diff --git a/chrome/browser/extensions/crx_installer.cc b/chrome/browser/extensions/crx_installer.cc
index 2c6042f1496b898e30d65c52d5f9a5b428562571..a1b672c34e13f60a28c6c2f69c9bd2835c90784f 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;
« no previous file with comments | « chrome/browser/extensions/convert_web_app_unittest.cc ('k') | chrome/browser/extensions/extension_management_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698