OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/url_pattern_index/url_rule_test_support.h" | 5 #include "components/url_pattern_index/url_rule_test_support.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" | 8 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" |
9 #include "url/gurl.h" | 9 #include "url/gurl.h" |
10 #include "url/origin.h" | 10 #include "url/origin.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 domain->set_domain(std::move(domain_pattern)); | 39 domain->set_domain(std::move(domain_pattern)); |
40 } | 40 } |
41 } | 41 } |
42 | 42 |
43 url::Origin GetOrigin(base::StringPiece origin_string) { | 43 url::Origin GetOrigin(base::StringPiece origin_string) { |
44 return !origin_string.empty() ? url::Origin(GURL(origin_string)) | 44 return !origin_string.empty() ? url::Origin(GURL(origin_string)) |
45 : url::Origin(); | 45 : url::Origin(); |
46 } | 46 } |
47 | 47 |
48 bool IsThirdParty(const GURL& url, const url::Origin& first_party_origin) { | 48 bool IsThirdParty(const GURL& url, const url::Origin& first_party_origin) { |
49 return first_party_origin.unique() || | 49 return first_party_origin.opaque() || |
50 !net::registry_controlled_domains::SameDomainOrHost( | 50 !net::registry_controlled_domains::SameDomainOrHost( |
51 url, first_party_origin, | 51 url, first_party_origin, |
52 net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES); | 52 net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES); |
53 } | 53 } |
54 | 54 |
55 } // namespace testing | 55 } // namespace testing |
56 } // namespace url_pattern_index | 56 } // namespace url_pattern_index |
OLD | NEW |