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 #include "chrome/renderer/safe_browsing/phishing_classifier.h" | 5 #include "chrome/renderer/safe_browsing/phishing_classifier.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 void PhishingClassifier::set_phishing_scorer(const Scorer* scorer) { | 53 void PhishingClassifier::set_phishing_scorer(const Scorer* scorer) { |
54 CheckNoPendingClassification(); | 54 CheckNoPendingClassification(); |
55 scorer_ = scorer; | 55 scorer_ = scorer; |
56 url_extractor_.reset(new PhishingUrlFeatureExtractor); | 56 url_extractor_.reset(new PhishingUrlFeatureExtractor); |
57 dom_extractor_.reset( | 57 dom_extractor_.reset( |
58 new PhishingDOMFeatureExtractor(render_view_, clock_.get())); | 58 new PhishingDOMFeatureExtractor(render_view_, clock_.get())); |
59 term_extractor_.reset(new PhishingTermFeatureExtractor( | 59 term_extractor_.reset(new PhishingTermFeatureExtractor( |
60 &scorer_->page_terms(), | 60 &scorer_->page_terms(), |
61 &scorer_->page_words(), | 61 &scorer_->page_words(), |
62 scorer_->max_words_per_term(), | 62 scorer_->max_words_per_term(), |
| 63 scorer_->murmurhash3_seed(), |
63 clock_.get())); | 64 clock_.get())); |
64 } | 65 } |
65 | 66 |
66 bool PhishingClassifier::is_ready() const { | 67 bool PhishingClassifier::is_ready() const { |
67 return scorer_ != NULL; | 68 return scorer_ != NULL; |
68 } | 69 } |
69 | 70 |
70 void PhishingClassifier::BeginClassification(const string16* page_text, | 71 void PhishingClassifier::BeginClassification(const string16* page_text, |
71 DoneCallback* done_callback) { | 72 DoneCallback* done_callback) { |
72 DCHECK(is_ready()); | 73 DCHECK(is_ready()); |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 RunCallback(verdict); | 220 RunCallback(verdict); |
220 } | 221 } |
221 | 222 |
222 void PhishingClassifier::Clear() { | 223 void PhishingClassifier::Clear() { |
223 page_text_ = NULL; | 224 page_text_ = NULL; |
224 done_callback_.reset(NULL); | 225 done_callback_.reset(NULL); |
225 features_.reset(NULL); | 226 features_.reset(NULL); |
226 } | 227 } |
227 | 228 |
228 } // namespace safe_browsing | 229 } // namespace safe_browsing |
OLD | NEW |