| 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 // This class loads a client-side model and lets you compute a phishing score | 5 // This class loads a client-side model and lets you compute a phishing score |
| 6 // for a set of previously extracted features. The phishing score corresponds | 6 // for a set of previously extracted features. The phishing score corresponds |
| 7 // to the probability that the features are indicative of a phishing site. | 7 // to the probability that the features are indicative of a phishing site. |
| 8 // | 8 // |
| 9 // For more details on how the score is actually computed for a given model | 9 // For more details on how the score is actually computed for a given model |
| 10 // and a given set of features read the comments in client_model.proto file. | 10 // and a given set of features read the comments in client_model.proto file. |
| 11 // | 11 // |
| 12 // See features.h for a list of features that are currently used. | 12 // See features.h for a list of features that are currently used. |
| 13 | 13 |
| 14 #ifndef CHROME_RENDERER_SAFE_BROWSING_SCORER_H_ | 14 #ifndef COMPONENTS_SAFE_BROWSING_RENDERER_SCORER_H_ |
| 15 #define CHROME_RENDERER_SAFE_BROWSING_SCORER_H_ | 15 #define COMPONENTS_SAFE_BROWSING_RENDERER_SCORER_H_ |
| 16 | 16 |
| 17 #include <stddef.h> | 17 #include <stddef.h> |
| 18 #include <stdint.h> | 18 #include <stdint.h> |
| 19 | 19 |
| 20 #include <string> | 20 #include <string> |
| 21 | 21 |
| 22 #include "base/containers/hash_tables.h" | 22 #include "base/containers/hash_tables.h" |
| 23 #include "base/macros.h" | 23 #include "base/macros.h" |
| 24 #include "base/strings/string_piece.h" | 24 #include "base/strings/string_piece.h" |
| 25 // TODO(timvolodine): move proto to components |
| 25 #include "chrome/common/safe_browsing/client_model.pb.h" | 26 #include "chrome/common/safe_browsing/client_model.pb.h" |
| 26 | 27 |
| 27 namespace safe_browsing { | 28 namespace safe_browsing { |
| 28 class FeatureMap; | 29 class FeatureMap; |
| 29 | 30 |
| 30 // Scorer methods are virtual to simplify mocking of this class. | 31 // Scorer methods are virtual to simplify mocking of this class. |
| 31 class Scorer { | 32 class Scorer { |
| 32 public: | 33 public: |
| 33 virtual ~Scorer(); | 34 virtual ~Scorer(); |
| 34 | 35 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 const FeatureMap& features) const; | 84 const FeatureMap& features) const; |
| 84 | 85 |
| 85 ClientSideModel model_; | 86 ClientSideModel model_; |
| 86 base::hash_set<std::string> page_terms_; | 87 base::hash_set<std::string> page_terms_; |
| 87 base::hash_set<uint32_t> page_words_; | 88 base::hash_set<uint32_t> page_words_; |
| 88 | 89 |
| 89 DISALLOW_COPY_AND_ASSIGN(Scorer); | 90 DISALLOW_COPY_AND_ASSIGN(Scorer); |
| 90 }; | 91 }; |
| 91 } // namespace safe_browsing | 92 } // namespace safe_browsing |
| 92 | 93 |
| 93 #endif // CHROME_RENDERER_SAFE_BROWSING_SCORER_H_ | 94 #endif // COMPONENTS_SAFE_BROWSING_RENDERER_SCORER_H_ |
| OLD | NEW |