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

Unified Diff: net/ftp/ftp_util.cc

Issue 1215933004: New new versions of Starts/EndsWith and SplitString in net (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@starts_with
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
« no previous file with comments | « net/ftp/ftp_network_transaction.cc ('k') | net/http/http_auth_cache.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/ftp/ftp_util.cc
diff --git a/net/ftp/ftp_util.cc b/net/ftp/ftp_util.cc
index a653dee8be58b2386bc21127e3dc84acb91c1a6b..91854c4b45b09fd9d6c464a7bf8272c12b330ccf 100644
--- a/net/ftp/ftp_util.cc
+++ b/net/ftp/ftp_util.cc
@@ -296,8 +296,9 @@ bool FtpUtil::WindowsDateListingToTime(const base::string16& date,
base::Time::Exploded time_exploded = { 0 };
// Date should be in format MM-DD-YY[YY].
- std::vector<base::string16> date_parts;
- base::SplitString(date, '-', &date_parts);
+ std::vector<base::StringPiece16> date_parts =
+ base::SplitStringPiece(date, base::ASCIIToUTF16("-"),
+ base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
if (date_parts.size() != 3)
return false;
if (!base::StringToInt(date_parts[0], &time_exploded.month))
@@ -319,8 +320,9 @@ bool FtpUtil::WindowsDateListingToTime(const base::string16& date,
if (time.length() < 5)
return false;
- std::vector<base::string16> time_parts;
- base::SplitString(time.substr(0, 5), ':', &time_parts);
+ std::vector<base::StringPiece16> time_parts = base::SplitStringPiece(
+ base::StringPiece16(time).substr(0, 5), base::ASCIIToUTF16(":"),
+ base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
if (time_parts.size() != 2)
return false;
if (!base::StringToInt(time_parts[0], &time_exploded.hour))
« no previous file with comments | « net/ftp/ftp_network_transaction.cc ('k') | net/http/http_auth_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698