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 // This file contains utilities related to working with "facets". | 5 // This file contains utilities related to working with "facets". |
6 // | 6 // |
7 // A "facet" is defined as the manifestation of a logical application on a given | 7 // A "facet" is defined as the manifestation of a logical application on a given |
8 // platform. For example, "My Bank" may have released an Android application | 8 // platform. For example, "My Bank" may have released an Android application |
9 // and a Web application accessible from a browser. These are all facets of the | 9 // and a Web application accessible from a browser. These are all facets of the |
10 // "My Bank" logical application. | 10 // "My Bank" logical application. |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 }; | 156 }; |
157 | 157 |
158 // A collection of facets affiliated with each other, i.e. an equivalence class. | 158 // A collection of facets affiliated with each other, i.e. an equivalence class. |
159 typedef std::vector<FacetURI> AffiliatedFacets; | 159 typedef std::vector<FacetURI> AffiliatedFacets; |
160 | 160 |
161 // A collection of facets affiliated with each other, i.e. an equivalence class, | 161 // A collection of facets affiliated with each other, i.e. an equivalence class, |
162 // plus a timestamp that indicates the last time the data was updated from an | 162 // plus a timestamp that indicates the last time the data was updated from an |
163 // authoritative source. | 163 // authoritative source. |
164 struct AffiliatedFacetsWithUpdateTime { | 164 struct AffiliatedFacetsWithUpdateTime { |
165 AffiliatedFacetsWithUpdateTime(); | 165 AffiliatedFacetsWithUpdateTime(); |
| 166 AffiliatedFacetsWithUpdateTime(const AffiliatedFacetsWithUpdateTime& other); |
166 ~AffiliatedFacetsWithUpdateTime(); | 167 ~AffiliatedFacetsWithUpdateTime(); |
167 | 168 |
168 AffiliatedFacets facets; | 169 AffiliatedFacets facets; |
169 base::Time last_update_time; | 170 base::Time last_update_time; |
170 }; | 171 }; |
171 | 172 |
172 // Returns whether or not equivalence classes |a| and |b| are equal, that is, | 173 // Returns whether or not equivalence classes |a| and |b| are equal, that is, |
173 // whether or not they consist of the same set of facets. | 174 // whether or not they consist of the same set of facets. |
174 // | 175 // |
175 // Note that this will do some sorting, so it can be expensive for large inputs. | 176 // Note that this will do some sorting, so it can be expensive for large inputs. |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 template <> | 215 template <> |
215 struct hash<password_manager::FacetURI> { | 216 struct hash<password_manager::FacetURI> { |
216 size_t operator()(const password_manager::FacetURI& facet_uri) const { | 217 size_t operator()(const password_manager::FacetURI& facet_uri) const { |
217 return hash<std::string>()(facet_uri.potentially_invalid_spec()); | 218 return hash<std::string>()(facet_uri.potentially_invalid_spec()); |
218 } | 219 } |
219 }; | 220 }; |
220 | 221 |
221 } // namespace BASE_HASH_NAMESPACE | 222 } // namespace BASE_HASH_NAMESPACE |
222 | 223 |
223 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_AFFILIATION_UTILS_H_ | 224 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_AFFILIATION_UTILS_H_ |
OLD | NEW |