| 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 CHROME_RENDERER_SAFE_BROWSING_SCORER_H_ |
| 15 #define CHROME_RENDERER_SAFE_BROWSING_SCORER_H_ | 15 #define CHROME_RENDERER_SAFE_BROWSING_SCORER_H_ |
| 16 | 16 |
| 17 #include <string> | 17 #include <string> |
| 18 | 18 |
| 19 #include "base/basictypes.h" | 19 #include "base/basictypes.h" |
| 20 #include "base/hash_tables.h" | 20 #include "base/containers/hash_tables.h" |
| 21 #include "base/strings/string_piece.h" | 21 #include "base/strings/string_piece.h" |
| 22 #include "chrome/common/safe_browsing/client_model.pb.h" | 22 #include "chrome/common/safe_browsing/client_model.pb.h" |
| 23 | 23 |
| 24 namespace safe_browsing { | 24 namespace safe_browsing { |
| 25 class FeatureMap; | 25 class FeatureMap; |
| 26 | 26 |
| 27 // Scorer methods are virtual to simplify mocking of this class. | 27 // Scorer methods are virtual to simplify mocking of this class. |
| 28 class Scorer { | 28 class Scorer { |
| 29 public: | 29 public: |
| 30 virtual ~Scorer(); | 30 virtual ~Scorer(); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 | 75 |
| 76 ClientSideModel model_; | 76 ClientSideModel model_; |
| 77 base::hash_set<std::string> page_terms_; | 77 base::hash_set<std::string> page_terms_; |
| 78 base::hash_set<uint32> page_words_; | 78 base::hash_set<uint32> page_words_; |
| 79 | 79 |
| 80 DISALLOW_COPY_AND_ASSIGN(Scorer); | 80 DISALLOW_COPY_AND_ASSIGN(Scorer); |
| 81 }; | 81 }; |
| 82 } // namepsace safe_browsing | 82 } // namepsace safe_browsing |
| 83 | 83 |
| 84 #endif // CHROME_RENDERER_SAFE_BROWSING_SCORER_H_ | 84 #endif // CHROME_RENDERER_SAFE_BROWSING_SCORER_H_ |
| OLD | NEW |