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

Unified Diff: chrome/browser/extensions/convert_user_script.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/convert_user_script.cc
diff --git a/chrome/browser/extensions/convert_user_script.cc b/chrome/browser/extensions/convert_user_script.cc
index 8d7aafec716890d08a1b67e1ab3b6f0427b9874f..a8f2427d707bd13e74817f50bdfb35caf0b79368 100644
--- a/chrome/browser/extensions/convert_user_script.cc
+++ b/chrome/browser/extensions/convert_user_script.cc
@@ -102,10 +102,10 @@ scoped_refptr<Extension> ConvertUserScriptToExtension(
// If the script provides its own match patterns, we use those. Otherwise, we
// generate some using the include globs.
ListValue* matches = new ListValue();
- if (!script.url_patterns().empty()) {
- for (size_t i = 0; i < script.url_patterns().size(); ++i) {
- matches->Append(Value::CreateStringValue(
- script.url_patterns()[i].GetAsString()));
+ if (!script.url_patterns().is_empty()) {
+ for (URLPatternSet::const_iterator i = script.url_patterns().begin();
+ i != script.url_patterns().end(); ++i) {
+ matches->Append(Value::CreateStringValue(i->GetAsString()));
}
} else {
// TODO(aa): Derive tighter matches where possible.
« no previous file with comments | « chrome/browser/automation/testing_automation_provider.cc ('k') | chrome/browser/extensions/convert_user_script_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698