Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4683)

Unified Diff: chrome/renderer/safe_browsing/phishing_url_feature_extractor.cc

Issue 1240183002: Update SplitString calls in chrome. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/renderer/safe_browsing/phishing_url_feature_extractor.cc
diff --git a/chrome/renderer/safe_browsing/phishing_url_feature_extractor.cc b/chrome/renderer/safe_browsing/phishing_url_feature_extractor.cc
index f42837d48b74cb79e8845ca08831c4beb050b50b..65351c638c3fb3300864e9bf333b4b4bd15a5a56 100644
--- a/chrome/renderer/safe_browsing/phishing_url_feature_extractor.cc
+++ b/chrome/renderer/safe_browsing/phishing_url_feature_extractor.cc
@@ -58,12 +58,8 @@ bool PhishingUrlFeatureExtractor::ExtractFeatures(const GURL& url,
// Pull off the TLD and the preceeding dot.
host.erase(tld_start - 1);
- std::vector<std::string> host_tokens;
- base::SplitStringDontTrim(host, '.', &host_tokens);
- // Get rid of any empty components.
- std::vector<std::string>::iterator new_end =
- std::remove(host_tokens.begin(), host_tokens.end(), "");
- host_tokens.erase(new_end, host_tokens.end());
+ std::vector<std::string> host_tokens = base::SplitString(
+ host, ".", base::KEEP_WHITESPACE, base::SPLIT_WANT_NONEMPTY);
if (host_tokens.empty()) {
DVLOG(1) << "Could not find domain for host: " << host;
return false;
« no previous file with comments | « chrome/renderer/page_load_histograms.cc ('k') | chrome/renderer/spellchecker/spellcheck_worditerator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698