diff options
Diffstat (limited to 'chrome/renderer')
-rw-r--r-- | chrome/renderer/media/chrome_key_systems.cc | 6 | ||||
-rw-r--r-- | chrome/renderer/page_load_histograms.cc | 4 | ||||
-rw-r--r-- | chrome/renderer/safe_browsing/phishing_url_feature_extractor.cc | 8 | ||||
-rw-r--r-- | chrome/renderer/spellchecker/spellcheck_worditerator_unittest.cc | 6 | ||||
-rw-r--r-- | chrome/renderer/web_apps.cc | 12 |
5 files changed, 17 insertions, 19 deletions
diff --git a/chrome/renderer/media/chrome_key_systems.cc b/chrome/renderer/media/chrome_key_systems.cc index c1db59a..8011275 100644 --- a/chrome/renderer/media/chrome_key_systems.cc +++ b/chrome/renderer/media/chrome_key_systems.cc @@ -137,9 +137,9 @@ void GetSupportedCodecsForPepperCdm( DLOG(WARNING) << "Non-UTF-8 codecs string."; // Continue using the best effort conversion. } - base::SplitString(codecs_string, - kCdmSupportedCodecsValueDelimiter, - codecs); + *codecs = base::SplitString( + codecs_string, std::string(1, kCdmSupportedCodecsValueDelimiter), + base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); break; } } diff --git a/chrome/renderer/page_load_histograms.cc b/chrome/renderer/page_load_histograms.cc index 78c1d5f..f0322042 100644 --- a/chrome/renderer/page_load_histograms.cc +++ b/chrome/renderer/page_load_histograms.cc @@ -165,9 +165,9 @@ bool ViaHeaderContains(WebFrame* frame, const std::string& via_value) { // separated by a comma corresponds to a proxy. The value added by a proxy is // not expected to contain any commas. // Example., Via: 1.0 Compression proxy, 1.1 Google Instant Proxy Preview - base::SplitString( + values = base::SplitString( frame->dataSource()->response().httpHeaderField(kViaHeaderName).utf8(), - ',', &values); + ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); return std::find(values.begin(), values.end(), via_value) != values.end(); } diff --git a/chrome/renderer/safe_browsing/phishing_url_feature_extractor.cc b/chrome/renderer/safe_browsing/phishing_url_feature_extractor.cc index f42837d..65351c6 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; diff --git a/chrome/renderer/spellchecker/spellcheck_worditerator_unittest.cc b/chrome/renderer/spellchecker/spellcheck_worditerator_unittest.cc index 491a8f2..08809de 100644 --- a/chrome/renderer/spellchecker/spellcheck_worditerator_unittest.cc +++ b/chrome/renderer/spellchecker/spellcheck_worditerator_unittest.cc @@ -125,9 +125,9 @@ TEST(SpellcheckWordIteratorTest, SplitWord) { kTestCases[i].allow_contraction)); EXPECT_TRUE(iterator.SetText(input.c_str(), input.length())); - std::vector<base::string16> expected_words; - base::SplitString( - base::WideToUTF16(kTestCases[i].expected_words), ' ', &expected_words); + std::vector<base::string16> expected_words = base::SplitString( + base::WideToUTF16(kTestCases[i].expected_words), + base::string16(1, ' '), base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); base::string16 actual_word; int actual_start, actual_end; diff --git a/chrome/renderer/web_apps.cc b/chrome/renderer/web_apps.cc index aadacca..95514bb 100644 --- a/chrome/renderer/web_apps.cc +++ b/chrome/renderer/web_apps.cc @@ -39,7 +39,7 @@ namespace { // Sizes a single size (the width or height) from a 'sizes' attribute. A size // matches must match the following regex: [1-9][0-9]*. -int ParseSingleIconSize(const base::string16& text) { +int ParseSingleIconSize(const base::StringPiece16& text) { // Size must not start with 0, and be between 0 and 9. if (text.empty() || !(text[0] >= L'1' && text[0] <= L'9')) return 0; @@ -59,8 +59,9 @@ int ParseSingleIconSize(const base::string16& text) { // [1-9][0-9]*x[1-9][0-9]*. // If the input couldn't be parsed, a size with a width/height == 0 is returned. gfx::Size ParseIconSize(const base::string16& text) { - std::vector<base::string16> sizes; - base::SplitStringDontTrim(text, L'x', &sizes); + std::vector<base::StringPiece16> sizes = base::SplitStringPiece( + text, base::string16(1, 'x'), + base::KEEP_WHITESPACE, base::SPLIT_WANT_ALL); if (sizes.size() != 2) return gfx::Size(); @@ -99,8 +100,9 @@ bool ParseIconSizes(const base::string16& text, std::vector<gfx::Size>* sizes, bool* is_any) { *is_any = false; - std::vector<base::string16> size_strings; - base::SplitStringAlongWhitespace(text, &size_strings); + std::vector<base::string16> size_strings = base::SplitString( + text, base::kWhitespaceASCIIAs16, + base::KEEP_WHITESPACE, base::SPLIT_WANT_NONEMPTY); for (size_t i = 0; i < size_strings.size(); ++i) { if (base::EqualsASCII(size_strings[i], "any")) { *is_any = true; |