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_delegate.h" | 5 #include "chrome/renderer/safe_browsing/phishing_classifier_delegate.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
| 9 #include "base/bind.h" |
9 #include "base/callback.h" | 10 #include "base/callback.h" |
10 #include "base/lazy_instance.h" | 11 #include "base/lazy_instance.h" |
11 #include "base/logging.h" | 12 #include "base/logging.h" |
12 #include "base/metrics/histogram.h" | 13 #include "base/metrics/histogram.h" |
13 #include "base/memory/scoped_callback_factory.h" | 14 #include "base/memory/scoped_callback_factory.h" |
14 #include "chrome/common/safe_browsing/csd.pb.h" | 15 #include "chrome/common/safe_browsing/csd.pb.h" |
15 #include "chrome/common/safe_browsing/safebrowsing_messages.h" | 16 #include "chrome/common/safe_browsing/safebrowsing_messages.h" |
16 #include "chrome/renderer/safe_browsing/feature_extractor_clock.h" | 17 #include "chrome/renderer/safe_browsing/feature_extractor_clock.h" |
17 #include "chrome/renderer/safe_browsing/phishing_classifier.h" | 18 #include "chrome/renderer/safe_browsing/phishing_classifier.h" |
18 #include "chrome/renderer/safe_browsing/scorer.h" | 19 #include "chrome/renderer/safe_browsing/scorer.h" |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 // Keep classifier_page_text_, in case the browser notifies us later that | 276 // Keep classifier_page_text_, in case the browser notifies us later that |
276 // we should classify the URL. | 277 // we should classify the URL. |
277 return; | 278 return; |
278 } | 279 } |
279 | 280 |
280 VLOG(2) << "Starting classification for " << last_finished_load_url_; | 281 VLOG(2) << "Starting classification for " << last_finished_load_url_; |
281 last_url_sent_to_classifier_ = last_finished_load_url_; | 282 last_url_sent_to_classifier_ = last_finished_load_url_; |
282 is_classifying_ = true; | 283 is_classifying_ = true; |
283 classifier_->BeginClassification( | 284 classifier_->BeginClassification( |
284 &classifier_page_text_, | 285 &classifier_page_text_, |
285 NewCallback(this, &PhishingClassifierDelegate::ClassificationDone)); | 286 base::Bind(&PhishingClassifierDelegate::ClassificationDone, |
| 287 base::Unretained(this))); |
286 } | 288 } |
287 | 289 |
288 } // namespace safe_browsing | 290 } // namespace safe_browsing |
OLD | NEW |