Index: components/domain_reliability/util.cc |
diff --git a/components/domain_reliability/util.cc b/components/domain_reliability/util.cc |
index f4af66913019c4356acd43123e80d98505c274de..20bf7568376d19f308afdb0ea494ff82f07c5d1c 100644 |
--- a/components/domain_reliability/util.cc |
+++ b/components/domain_reliability/util.cc |
@@ -170,22 +170,23 @@ void GetUploadResultFromResponseDetails( |
return; |
} |
-// N.B. This uses a ScopedVector because that's what JSONValueConverter uses |
-// for repeated fields of any type, and Config uses JSONValueConverter to parse |
-// JSON configs. |
-GURL SanitizeURLForReport(const GURL& beacon_url, |
- const GURL& collector_url, |
- const ScopedVector<std::string>& path_prefixes) { |
+// N.B. This uses a std::vector<std::unique_ptr<>> because that's what |
+// JSONValueConverter uses for repeated fields of any type, and Config uses |
+// JSONValueConverter to parse JSON configs. |
+GURL SanitizeURLForReport( |
+ const GURL& beacon_url, |
+ const GURL& collector_url, |
+ const std::vector<std::unique_ptr<std::string>>& path_prefixes) { |
if (CanReportFullBeaconURLToCollector(beacon_url, collector_url)) |
return beacon_url.GetAsReferrer(); |
std::string path = beacon_url.path(); |
const std::string empty_path; |
const std::string* longest_path_prefix = &empty_path; |
- for (const std::string* path_prefix : path_prefixes) { |
+ for (const auto& path_prefix : path_prefixes) { |
if (path.substr(0, path_prefix->length()) == *path_prefix && |
path_prefix->length() > longest_path_prefix->length()) { |
- longest_path_prefix = path_prefix; |
+ longest_path_prefix = path_prefix.get(); |
} |
} |