| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // PhishingTermFeatureExtractor handles computing term features from the text | 5 // PhishingTermFeatureExtractor handles computing term features from the text |
| 6 // of a web page for the client-side phishing detection model. To do this, it | 6 // of a web page for the client-side phishing detection model. To do this, it |
| 7 // takes a list of terms that appear in the model, and scans through the page | 7 // takes a list of terms that appear in the model, and scans through the page |
| 8 // text looking for them. Any terms that appear will cause a corresponding | 8 // text looking for them. Any terms that appear will cause a corresponding |
| 9 // features::kPageTerm feature to be added to the FeatureMap. | 9 // features::kPageTerm feature to be added to the FeatureMap. |
| 10 // | 10 // |
| 11 // To make it harder for a phisher to enumerate all of the relevant terms in | 11 // To make it harder for a phisher to enumerate all of the relevant terms in |
| 12 // the model, the terms are provided as SHA-256 hashes, rather than plain text. | 12 // the model, the terms are provided as SHA-256 hashes, rather than plain text. |
| 13 // | 13 // |
| 14 // There is one PhishingTermFeatureExtractor per RenderView. | 14 // There is one PhishingTermFeatureExtractor per RenderView. |
| 15 | 15 |
| 16 #ifndef CHROME_RENDERER_SAFE_BROWSING_PHISHING_TERM_FEATURE_EXTRACTOR_H_ | 16 #ifndef COMPONENTS_SAFE_BROWSING_RENDERER_PHISHING_TERM_FEATURE_EXTRACTOR_H_ |
| 17 #define CHROME_RENDERER_SAFE_BROWSING_PHISHING_TERM_FEATURE_EXTRACTOR_H_ | 17 #define COMPONENTS_SAFE_BROWSING_RENDERER_PHISHING_TERM_FEATURE_EXTRACTOR_H_ |
| 18 | 18 |
| 19 #include <stddef.h> | 19 #include <stddef.h> |
| 20 #include <stdint.h> | 20 #include <stdint.h> |
| 21 | 21 |
| 22 #include <memory> | 22 #include <memory> |
| 23 #include <set> | 23 #include <set> |
| 24 #include <string> | 24 #include <string> |
| 25 | 25 |
| 26 #include "base/callback.h" | 26 #include "base/callback.h" |
| 27 #include "base/containers/hash_tables.h" | 27 #include "base/containers/hash_tables.h" |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 | 162 |
| 163 // Used in scheduling ExtractFeaturesWithTimeout tasks. | 163 // Used in scheduling ExtractFeaturesWithTimeout tasks. |
| 164 // These pointers are invalidated if extraction is cancelled. | 164 // These pointers are invalidated if extraction is cancelled. |
| 165 base::WeakPtrFactory<PhishingTermFeatureExtractor> weak_factory_; | 165 base::WeakPtrFactory<PhishingTermFeatureExtractor> weak_factory_; |
| 166 | 166 |
| 167 DISALLOW_COPY_AND_ASSIGN(PhishingTermFeatureExtractor); | 167 DISALLOW_COPY_AND_ASSIGN(PhishingTermFeatureExtractor); |
| 168 }; | 168 }; |
| 169 | 169 |
| 170 } // namespace safe_browsing | 170 } // namespace safe_browsing |
| 171 | 171 |
| 172 #endif // CHROME_RENDERER_SAFE_BROWSING_PHISHING_TERM_FEATURE_EXTRACTOR_H_ | 172 #endif // COMPONENTS_SAFE_BROWSING_RENDERER_PHISHING_TERM_FEATURE_EXTRACTOR_H_ |
| OLD | NEW |