| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 class handles the process of extracting all of the features from a | 5 // This class handles the process of extracting all of the features from a |
| 6 // page and computing a phishyness score. The basic steps are: | 6 // page and computing a phishyness score. The basic steps are: |
| 7 // - Run each feature extractor over the page, building up a FeatureMap of | 7 // - Run each feature extractor over the page, building up a FeatureMap of |
| 8 // feature -> value. | 8 // feature -> value. |
| 9 // - SHA-256 hash all of the feature names in the map so that they match the | 9 // - SHA-256 hash all of the feature names in the map so that they match the |
| 10 // supplied model. | 10 // supplied model. |
| 11 // - Hand the hashed map off to a Scorer, which computes the probability that | 11 // - Hand the hashed map off to a Scorer, which computes the probability that |
| 12 // the page is phishy. | 12 // the page is phishy. |
| 13 // - If the page is phishy, run the supplied callback. | 13 // - If the page is phishy, run the supplied callback. |
| 14 // | 14 // |
| 15 // For more details, see phishing_*_feature_extractor.h, scorer.h, and | 15 // For more details, see phishing_*_feature_extractor.h, scorer.h, and |
| 16 // client_model.proto. | 16 // client_model.proto. |
| 17 | 17 |
| 18 #ifndef CHROME_RENDERER_SAFE_BROWSING_PHISHING_CLASSIFIER_H_ | 18 #ifndef COMPONENTS_SAFE_BROWSING_RENDERER_PHISHING_CLASSIFIER_H_ |
| 19 #define CHROME_RENDERER_SAFE_BROWSING_PHISHING_CLASSIFIER_H_ | 19 #define COMPONENTS_SAFE_BROWSING_RENDERER_PHISHING_CLASSIFIER_H_ |
| 20 | 20 |
| 21 #include <stdint.h> | 21 #include <stdint.h> |
| 22 | 22 |
| 23 #include <memory> | 23 #include <memory> |
| 24 #include <set> | 24 #include <set> |
| 25 | 25 |
| 26 #include "base/callback.h" | 26 #include "base/callback.h" |
| 27 #include "base/macros.h" | 27 #include "base/macros.h" |
| 28 #include "base/memory/weak_ptr.h" | 28 #include "base/memory/weak_ptr.h" |
| 29 #include "base/strings/string16.h" | 29 #include "base/strings/string16.h" |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 | 145 |
| 146 // Used in scheduling BeginFeatureExtraction tasks. | 146 // Used in scheduling BeginFeatureExtraction tasks. |
| 147 // These pointers are invalidated if classification is cancelled. | 147 // These pointers are invalidated if classification is cancelled. |
| 148 base::WeakPtrFactory<PhishingClassifier> weak_factory_; | 148 base::WeakPtrFactory<PhishingClassifier> weak_factory_; |
| 149 | 149 |
| 150 DISALLOW_COPY_AND_ASSIGN(PhishingClassifier); | 150 DISALLOW_COPY_AND_ASSIGN(PhishingClassifier); |
| 151 }; | 151 }; |
| 152 | 152 |
| 153 } // namespace safe_browsing | 153 } // namespace safe_browsing |
| 154 | 154 |
| 155 #endif // CHROME_RENDERER_SAFE_BROWSING_PHISHING_CLASSIFIER_H_ | 155 #endif // COMPONENTS_SAFE_BROWSING_RENDERER_PHISHING_CLASSIFIER_H_ |
| OLD | NEW |