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/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 bool IsKnownList(const std::string& name) { | 22 bool IsKnownList(const std::string& name) { |
23 for (size_t i = 0; i < arraysize(kAllLists); ++i) { | 23 for (size_t i = 0; i < arraysize(kAllLists); ++i) { |
24 if (!strcmp(kAllLists[i], name.c_str())) { | 24 if (!strcmp(kAllLists[i], name.c_str())) { |
25 return true; | 25 return true; |
26 } | 26 } |
27 } | 27 } |
28 return false; | 28 return false; |
29 } | 29 } |
30 } // namespace | 30 } // namespace |
31 | 31 |
| 32 // ThreatMetadata ------------------------------------------------------------ |
| 33 ThreatMetadata::ThreatMetadata() |
| 34 : threat_pattern_type(ThreatPatternType::NONE) {} |
| 35 |
| 36 ThreatMetadata::~ThreatMetadata() {} |
| 37 |
32 // SBCachedFullHashResult ------------------------------------------------------ | 38 // SBCachedFullHashResult ------------------------------------------------------ |
33 | 39 |
34 SBCachedFullHashResult::SBCachedFullHashResult() {} | 40 SBCachedFullHashResult::SBCachedFullHashResult() {} |
35 | 41 |
36 SBCachedFullHashResult::SBCachedFullHashResult( | 42 SBCachedFullHashResult::SBCachedFullHashResult( |
37 const base::Time& in_expire_after) | 43 const base::Time& in_expire_after) |
38 : expire_after(in_expire_after) {} | 44 : expire_after(in_expire_after) {} |
39 | 45 |
40 SBCachedFullHashResult::SBCachedFullHashResult( | 46 SBCachedFullHashResult::SBCachedFullHashResult( |
41 const SBCachedFullHashResult& other) = default; | 47 const SBCachedFullHashResult& other) = default; |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 GenerateHostsToCheck(url, &hosts); | 420 GenerateHostsToCheck(url, &hosts); |
415 GeneratePathsToCheck(url, &paths); | 421 GeneratePathsToCheck(url, &paths); |
416 for (size_t h = 0; h < hosts.size(); ++h) { | 422 for (size_t h = 0; h < hosts.size(); ++h) { |
417 for (size_t p = 0; p < paths.size(); ++p) { | 423 for (size_t p = 0; p < paths.size(); ++p) { |
418 urls->push_back(hosts[h] + paths[p]); | 424 urls->push_back(hosts[h] + paths[p]); |
419 } | 425 } |
420 } | 426 } |
421 } | 427 } |
422 | 428 |
423 } // namespace safe_browsing | 429 } // namespace safe_browsing |
OLD | NEW |