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_dom_feature_extractor.h" | 5 #include "chrome/renderer/safe_browsing/phishing_dom_feature_extractor.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/hash_tables.h" | 9 #include "base/containers/hash_tables.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/message_loop.h" | 11 #include "base/message_loop.h" |
12 #include "base/metrics/histogram.h" | 12 #include "base/metrics/histogram.h" |
13 #include "base/string_util.h" | 13 #include "base/string_util.h" |
14 #include "base/time.h" | 14 #include "base/time.h" |
15 #include "chrome/renderer/safe_browsing/feature_extractor_clock.h" | 15 #include "chrome/renderer/safe_browsing/feature_extractor_clock.h" |
16 #include "chrome/renderer/safe_browsing/features.h" | 16 #include "chrome/renderer/safe_browsing/features.h" |
17 #include "content/public/renderer/render_view.h" | 17 #include "content/public/renderer/render_view.h" |
18 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" | 18 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" |
19 #include "third_party/WebKit/public/platform/WebString.h" | |
20 #include "third_party/WebKit/Source/WebKit/chromium/public/WebElement.h" | 19 #include "third_party/WebKit/Source/WebKit/chromium/public/WebElement.h" |
21 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 20 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNodeCollection.h" | 21 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNodeCollection.h" |
23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
| 23 #include "third_party/WebKit/public/platform/WebString.h" |
24 | 24 |
25 namespace safe_browsing { | 25 namespace safe_browsing { |
26 | 26 |
27 // This time should be short enough that it doesn't noticeably disrupt the | 27 // This time should be short enough that it doesn't noticeably disrupt the |
28 // user's interaction with the page. | 28 // user's interaction with the page. |
29 const int PhishingDOMFeatureExtractor::kMaxTimePerChunkMs = 10; | 29 const int PhishingDOMFeatureExtractor::kMaxTimePerChunkMs = 10; |
30 | 30 |
31 // Experimenting shows that we get a reasonable gain in performance by | 31 // Experimenting shows that we get a reasonable gain in performance by |
32 // increasing this up to around 10, but there's not much benefit in | 32 // increasing this up to around 10, but there's not much benefit in |
33 // increasing it past that. | 33 // increasing it past that. |
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 // Record number of script tags (discretized for numerical stability.) | 491 // Record number of script tags (discretized for numerical stability.) |
492 if (page_feature_state_->num_script_tags > 1) { | 492 if (page_feature_state_->num_script_tags > 1) { |
493 features_->AddBooleanFeature(features::kPageNumScriptTagsGTOne); | 493 features_->AddBooleanFeature(features::kPageNumScriptTagsGTOne); |
494 if (page_feature_state_->num_script_tags > 6) { | 494 if (page_feature_state_->num_script_tags > 6) { |
495 features_->AddBooleanFeature(features::kPageNumScriptTagsGTSix); | 495 features_->AddBooleanFeature(features::kPageNumScriptTagsGTSix); |
496 } | 496 } |
497 } | 497 } |
498 } | 498 } |
499 | 499 |
500 } // namespace safe_browsing | 500 } // namespace safe_browsing |
OLD | NEW |