OLD | NEW |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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/safe_browsing_db/util.h" | 5 #include "components/safe_browsing_db/util.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/trace_event/trace_event.h" | 10 #include "base/trace_event/trace_event.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 } // namespace | 31 } // namespace |
32 | 32 |
33 // ThreatMetadata ------------------------------------------------------------ | 33 // ThreatMetadata ------------------------------------------------------------ |
34 ThreatMetadata::ThreatMetadata() | 34 ThreatMetadata::ThreatMetadata() |
35 : threat_pattern_type(ThreatPatternType::NONE) {} | 35 : threat_pattern_type(ThreatPatternType::NONE) {} |
36 | 36 |
37 ThreatMetadata::ThreatMetadata(const ThreatMetadata& other) = default; | 37 ThreatMetadata::ThreatMetadata(const ThreatMetadata& other) = default; |
38 | 38 |
39 ThreatMetadata::~ThreatMetadata() {} | 39 ThreatMetadata::~ThreatMetadata() {} |
40 | 40 |
| 41 bool ThreatMetadata::operator==(const ThreatMetadata& other) const { |
| 42 return threat_pattern_type == other.threat_pattern_type && |
| 43 api_permissions == other.api_permissions && |
| 44 population_id == other.population_id; |
| 45 } |
| 46 |
| 47 bool ThreatMetadata::operator!=(const ThreatMetadata& other) const { |
| 48 return !operator==(other); |
| 49 } |
| 50 |
41 // SBCachedFullHashResult ------------------------------------------------------ | 51 // SBCachedFullHashResult ------------------------------------------------------ |
42 | 52 |
43 SBCachedFullHashResult::SBCachedFullHashResult() {} | 53 SBCachedFullHashResult::SBCachedFullHashResult() {} |
44 | 54 |
45 SBCachedFullHashResult::SBCachedFullHashResult( | 55 SBCachedFullHashResult::SBCachedFullHashResult( |
46 const base::Time& in_expire_after) | 56 const base::Time& in_expire_after) |
47 : expire_after(in_expire_after) {} | 57 : expire_after(in_expire_after) {} |
48 | 58 |
49 SBCachedFullHashResult::SBCachedFullHashResult( | 59 SBCachedFullHashResult::SBCachedFullHashResult( |
50 const SBCachedFullHashResult& other) = default; | 60 const SBCachedFullHashResult& other) = default; |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 // that ends in '/' we also add the path without the slash. | 198 // that ends in '/' we also add the path without the slash. |
189 if (include_whitelist_hashes && path.size() > 1 && path.back() == '/') { | 199 if (include_whitelist_hashes && path.size() > 1 && path.back() == '/') { |
190 full_hashes->push_back(SBFullHashForString( | 200 full_hashes->push_back(SBFullHashForString( |
191 host + path.substr(0, path.size() - 1))); | 201 host + path.substr(0, path.size() - 1))); |
192 } | 202 } |
193 } | 203 } |
194 } | 204 } |
195 } | 205 } |
196 | 206 |
197 } // namespace safe_browsing | 207 } // namespace safe_browsing |
OLD | NEW |