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

Unified Diff: components/dom_distiller/standalone/content_extractor_browsertest.cc

Issue 1234973004: Update SplitString calls in components (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixes 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: components/dom_distiller/standalone/content_extractor_browsertest.cc
diff --git a/components/dom_distiller/standalone/content_extractor_browsertest.cc b/components/dom_distiller/standalone/content_extractor_browsertest.cc
index 963d181f51d8d5c53c67ec640615c146a5613b59..de20adee08e6bcc0737d9f4a6d7522cd06ed8a6e 100644
--- a/components/dom_distiller/standalone/content_extractor_browsertest.cc
+++ b/components/dom_distiller/standalone/content_extractor_browsertest.cc
@@ -248,8 +248,8 @@ class ContentExtractionRequest : public ViewRequestDelegate {
}
} else if (command_line.HasSwitch(kUrlsSwitch)) {
std::string urls_string = command_line.GetSwitchValueASCII(kUrlsSwitch);
- std::vector<std::string> urls;
- base::SplitString(urls_string, ' ', &urls);
+ std::vector<std::string> urls = base::SplitString(
+ urls_string, " ", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
// Check for original-urls switch, which must exactly pair up with
// |kUrlsSwitch| i.e. number of original urls must be same as that of
// urls.
@@ -257,8 +257,11 @@ class ContentExtractionRequest : public ViewRequestDelegate {
if (command_line.HasSwitch(kOriginalUrls)) {
std::string original_urls_string =
command_line.GetSwitchValueASCII(kOriginalUrls);
- base::SplitString(original_urls_string, ' ', &original_urls);
- if (original_urls.size() != urls.size()) original_urls.clear();
+ original_urls = base::SplitString(
+ original_urls_string, " ",
+ base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
+ if (original_urls.size() != urls.size())
+ original_urls.clear();
}
for (size_t i = 0; i < urls.size(); ++i) {
GURL url(urls[i]);
« no previous file with comments | « components/device_event_log/device_event_log_impl_unittest.cc ('k') | components/favicon_base/fallback_icon_url_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698