| 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 #include "chrome/renderer/safe_browsing/phishing_term_feature_extractor.h" | 5 #include "components/safe_browsing/renderer/phishing_term_feature_extractor.h" |
| 6 | 6 |
| 7 #include <list> | 7 #include <list> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| 11 | 11 |
| 12 #include "base/bind.h" | 12 #include "base/bind.h" |
| 13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
| 14 #include "base/i18n/break_iterator.h" | 14 #include "base/i18n/break_iterator.h" |
| 15 #include "base/i18n/case_conversion.h" | 15 #include "base/i18n/case_conversion.h" |
| 16 #include "base/location.h" | 16 #include "base/location.h" |
| 17 #include "base/logging.h" | 17 #include "base/logging.h" |
| 18 #include "base/metrics/histogram_macros.h" | 18 #include "base/metrics/histogram_macros.h" |
| 19 #include "base/single_thread_task_runner.h" | 19 #include "base/single_thread_task_runner.h" |
| 20 #include "base/strings/utf_string_conversions.h" | 20 #include "base/strings/utf_string_conversions.h" |
| 21 #include "base/threading/thread_task_runner_handle.h" | 21 #include "base/threading/thread_task_runner_handle.h" |
| 22 #include "base/time/time.h" | 22 #include "base/time/time.h" |
| 23 #include "chrome/renderer/safe_browsing/feature_extractor_clock.h" | 23 #include "components/safe_browsing/renderer/feature_extractor_clock.h" |
| 24 #include "chrome/renderer/safe_browsing/features.h" | 24 #include "components/safe_browsing/renderer/features.h" |
| 25 #include "chrome/renderer/safe_browsing/murmurhash3_util.h" | 25 #include "components/safe_browsing/renderer/murmurhash3_util.h" |
| 26 #include "crypto/sha2.h" | 26 #include "crypto/sha2.h" |
| 27 | 27 |
| 28 namespace safe_browsing { | 28 namespace safe_browsing { |
| 29 | 29 |
| 30 // This time should be short enough that it doesn't noticeably disrupt the | 30 // This time should be short enough that it doesn't noticeably disrupt the |
| 31 // user's interaction with the page. | 31 // user's interaction with the page. |
| 32 const int PhishingTermFeatureExtractor::kMaxTimePerChunkMs = 10; | 32 const int PhishingTermFeatureExtractor::kMaxTimePerChunkMs = 10; |
| 33 | 33 |
| 34 // Experimenting shows that we get a reasonable gain in performance by | 34 // Experimenting shows that we get a reasonable gain in performance by |
| 35 // increasing this up to around 10, but there's not much benefit in | 35 // increasing this up to around 10, but there's not much benefit in |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 | 289 |
| 290 void PhishingTermFeatureExtractor::Clear() { | 290 void PhishingTermFeatureExtractor::Clear() { |
| 291 page_text_ = NULL; | 291 page_text_ = NULL; |
| 292 features_ = NULL; | 292 features_ = NULL; |
| 293 shingle_hashes_ = NULL; | 293 shingle_hashes_ = NULL; |
| 294 done_callback_.Reset(); | 294 done_callback_.Reset(); |
| 295 state_.reset(NULL); | 295 state_.reset(NULL); |
| 296 } | 296 } |
| 297 | 297 |
| 298 } // namespace safe_browsing | 298 } // namespace safe_browsing |
| OLD | NEW |