| Index: components/url_matcher/regex_set_matcher.cc
|
| diff --git a/components/url_matcher/regex_set_matcher.cc b/components/url_matcher/regex_set_matcher.cc
|
| index ac48123aaf86a73a950c6f800eb3f24b1de23760..ae0eb595f31c398f43f356ce774fc87c003fba9b 100644
|
| --- a/components/url_matcher/regex_set_matcher.cc
|
| +++ b/components/url_matcher/regex_set_matcher.cc
|
| @@ -7,7 +7,7 @@
|
| #include <stddef.h>
|
|
|
| #include "base/logging.h"
|
| -#include "base/stl_util.h"
|
| +#include "base/memory/ptr_util.h"
|
| #include "base/strings/string_util.h"
|
| #include "components/url_matcher/substring_set_matcher.h"
|
| #include "third_party/re2/src/re2/filtered_re2.h"
|
| @@ -102,13 +102,16 @@ void RegexSetMatcher::RebuildMatcher() {
|
| // SubstringSetMatcher doesn't own its strings.
|
| for (size_t i = 0; i < strings_to_match.size(); ++i) {
|
| substring_patterns_.push_back(
|
| - new StringPattern(strings_to_match[i], i));
|
| + base::MakeUnique<StringPattern>(strings_to_match[i], i));
|
| }
|
| - substring_matcher_->RegisterPatterns(substring_patterns_);
|
| + std::vector<const StringPattern*> patterns;
|
| + for (const auto& pattern : substring_patterns_)
|
| + patterns.push_back(pattern.get());
|
| + substring_matcher_->RegisterPatterns(patterns);
|
| }
|
|
|
| void RegexSetMatcher::DeleteSubstringPatterns() {
|
| - base::STLDeleteElements(&substring_patterns_);
|
| + substring_patterns_.clear();
|
| }
|
|
|
| } // namespace url_matcher
|
|
|