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 "chrome/common/safe_browsing/binary_feature_extractor.h" | 5 #include "chrome/common/safe_browsing/binary_feature_extractor.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/files/file.h" | 10 #include "base/files/file.h" |
11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
12 #include "base/files/memory_mapped_file.h" | 12 #include "base/files/memory_mapped_file.h" |
13 #include "chrome/common/safe_browsing/csd.pb.h" | 13 #include "components/safe_browsing/csd.pb.h" |
14 #include "crypto/secure_hash.h" | 14 #include "crypto/secure_hash.h" |
15 #include "crypto/sha2.h" | 15 #include "crypto/sha2.h" |
16 | 16 |
17 namespace safe_browsing { | 17 namespace safe_browsing { |
18 | 18 |
19 BinaryFeatureExtractor::BinaryFeatureExtractor() {} | 19 BinaryFeatureExtractor::BinaryFeatureExtractor() {} |
20 | 20 |
21 BinaryFeatureExtractor::~BinaryFeatureExtractor() {} | 21 BinaryFeatureExtractor::~BinaryFeatureExtractor() {} |
22 | 22 |
23 bool BinaryFeatureExtractor::ExtractImageFeatures( | 23 bool BinaryFeatureExtractor::ExtractImageFeatures( |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 } | 62 } |
63 if (!len) { | 63 if (!len) { |
64 uint8_t hash[crypto::kSHA256Length]; | 64 uint8_t hash[crypto::kSHA256Length]; |
65 ctx->Finish(hash, sizeof(hash)); | 65 ctx->Finish(hash, sizeof(hash)); |
66 digests->set_sha256(hash, sizeof(hash)); | 66 digests->set_sha256(hash, sizeof(hash)); |
67 } | 67 } |
68 } | 68 } |
69 } | 69 } |
70 | 70 |
71 } // namespace safe_browsing | 71 } // namespace safe_browsing |
OLD | NEW |