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

Unified Diff: chrome/common/extensions/extension_messages.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/common/extensions/extension_messages.cc
diff --git a/chrome/common/extensions/extension_messages.cc b/chrome/common/extensions/extension_messages.cc
index 268d06ff710db3065a2581aeb831da21c24abfb9..587965f0e28b74c9b45368c73c2a3e6d6aec1cf7 100644
--- a/chrome/common/extensions/extension_messages.cc
+++ b/chrome/common/extensions/extension_messages.cc
@@ -99,7 +99,7 @@ bool ParamTraits<URLPattern>::Read(const Message* m, void** iter,
!ReadParam(m, iter, &spec))
return false;
- p->set_valid_schemes(valid_schemes);
+ p->SetValidSchemes(valid_schemes);
return URLPattern::PARSE_SUCCESS == p->Parse(spec, URLPattern::IGNORE_PORTS);
}
@@ -113,14 +113,15 @@ void ParamTraits<URLPatternSet>::Write(Message* m, const param_type& p) {
bool ParamTraits<URLPatternSet>::Read(const Message* m, void** iter,
param_type* p) {
- URLPatternList patterns;
+ std::set<URLPattern> patterns;
bool success =
ReadParam(m, iter, &patterns);
if (!success)
return false;
- for (size_t i = 0; i < patterns.size(); ++i)
- p->AddPattern(patterns[i]);
+ for (std::set<URLPattern>::iterator i = patterns.begin();
+ i != patterns.end(); ++i)
+ p->AddPattern(*i);
return true;
}
« no previous file with comments | « chrome/common/extensions/extension_manifests_unittest.cc ('k') | chrome/common/extensions/extension_permission_set.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698