| 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_url_feature_extractor.h" | 5 #include "chrome/renderer/safe_browsing/phishing_url_feature_extractor.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/metrics/histogram.h" | 12 #include "base/metrics/histogram_macros.h" |
| 13 #include "base/strings/string_split.h" | 13 #include "base/strings/string_split.h" |
| 14 #include "base/strings/string_util.h" | 14 #include "base/strings/string_util.h" |
| 15 #include "base/timer/elapsed_timer.h" | 15 #include "base/timer/elapsed_timer.h" |
| 16 #include "chrome/renderer/safe_browsing/features.h" | 16 #include "chrome/renderer/safe_browsing/features.h" |
| 17 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" | 17 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" |
| 18 #include "url/gurl.h" | 18 #include "url/gurl.h" |
| 19 | 19 |
| 20 namespace safe_browsing { | 20 namespace safe_browsing { |
| 21 | 21 |
| 22 PhishingUrlFeatureExtractor::PhishingUrlFeatureExtractor() {} | 22 PhishingUrlFeatureExtractor::PhishingUrlFeatureExtractor() {} |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 base::SplitStringPiece(full, kTokenSeparators, base::KEEP_WHITESPACE, | 108 base::SplitStringPiece(full, kTokenSeparators, base::KEEP_WHITESPACE, |
| 109 base::SPLIT_WANT_NONEMPTY)) { | 109 base::SPLIT_WANT_NONEMPTY)) { |
| 110 // Copy over only the splits that are 3 or more chars long. | 110 // Copy over only the splits that are 3 or more chars long. |
| 111 // TODO(bryner): Determine a meaningful min size. | 111 // TODO(bryner): Determine a meaningful min size. |
| 112 if (token.length() >= kMinPathComponentLength) | 112 if (token.length() >= kMinPathComponentLength) |
| 113 tokens->push_back(token.as_string()); | 113 tokens->push_back(token.as_string()); |
| 114 } | 114 } |
| 115 } | 115 } |
| 116 | 116 |
| 117 } // namespace safe_browsing | 117 } // namespace safe_browsing |
| OLD | NEW |