| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/password_manager/core/browser/affiliation_utils.h" | 5 #include "components/password_manager/core/browser/affiliation_utils.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <ostream> |
| 8 | 9 |
| 9 #include "base/base64.h" | 10 #include "base/base64.h" |
| 10 #include "base/strings/string_piece.h" | 11 #include "base/strings/string_piece.h" |
| 11 #include "base/strings/string_util.h" | 12 #include "base/strings/string_util.h" |
| 12 #include "net/base/escape.h" | 13 #include "net/base/escape.h" |
| 13 #include "url/third_party/mozilla/url_parse.h" | 14 #include "url/third_party/mozilla/url_parse.h" |
| 14 #include "url/url_canon_stdstring.h" | 15 #include "url/url_canon_stdstring.h" |
| 15 #include "url/url_util.h" | 16 #include "url/url_util.h" |
| 16 | 17 |
| 17 namespace password_manager { | 18 namespace password_manager { |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 | 262 |
| 262 AffiliatedFacetsWithUpdateTime::AffiliatedFacetsWithUpdateTime() { | 263 AffiliatedFacetsWithUpdateTime::AffiliatedFacetsWithUpdateTime() { |
| 263 } | 264 } |
| 264 | 265 |
| 265 AffiliatedFacetsWithUpdateTime::~AffiliatedFacetsWithUpdateTime() { | 266 AffiliatedFacetsWithUpdateTime::~AffiliatedFacetsWithUpdateTime() { |
| 266 } | 267 } |
| 267 | 268 |
| 268 | 269 |
| 269 // Helpers -------------------------------------------------------------------- | 270 // Helpers -------------------------------------------------------------------- |
| 270 | 271 |
| 272 std::ostream& operator<<(std::ostream& os, const FacetURI& facet_uri) { |
| 273 return os << facet_uri.potentially_invalid_spec(); |
| 274 } |
| 275 |
| 271 bool AreEquivalenceClassesEqual(const AffiliatedFacets& a, | 276 bool AreEquivalenceClassesEqual(const AffiliatedFacets& a, |
| 272 const AffiliatedFacets& b) { | 277 const AffiliatedFacets& b) { |
| 273 if (a.size() != b.size()) | 278 if (a.size() != b.size()) |
| 274 return false; | 279 return false; |
| 275 | 280 |
| 276 std::vector<FacetURI> a_sorted(a.begin(), a.end()); | 281 std::vector<FacetURI> a_sorted(a.begin(), a.end()); |
| 277 std::vector<FacetURI> b_sorted(b.begin(), b.end()); | 282 std::vector<FacetURI> b_sorted(b.begin(), b.end()); |
| 278 std::sort(a_sorted.begin(), a_sorted.end()); | 283 std::sort(a_sorted.begin(), a_sorted.end()); |
| 279 std::sort(b_sorted.begin(), b_sorted.end()); | 284 std::sort(b_sorted.begin(), b_sorted.end()); |
| 280 return std::equal(a_sorted.begin(), a_sorted.end(), b_sorted.begin()); | 285 return std::equal(a_sorted.begin(), a_sorted.end(), b_sorted.begin()); |
| 281 } | 286 } |
| 282 | 287 |
| 283 } // namespace password_manager | 288 } // namespace password_manager |
| OLD | NEW |