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/common/extensions/extension_messages.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/common/extensions/extension_messages.cc')
-rw-r--r-- | chrome/common/extensions/extension_messages.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/chrome/common/extensions/extension_messages.cc b/chrome/common/extensions/extension_messages.cc index 268d06f..587965f 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; } |