| Index: net/ftp/ftp_directory_listing_parser.cc
|
| diff --git a/net/ftp/ftp_directory_listing_parser.cc b/net/ftp/ftp_directory_listing_parser.cc
|
| index d19e4a2c9fe4b9b82551a25af4452aac4e8ce561..3e013cf349227d299b29220b5246bbd1bcd288cd 100644
|
| --- a/net/ftp/ftp_directory_listing_parser.cc
|
| +++ b/net/ftp/ftp_directory_listing_parser.cc
|
| @@ -29,7 +29,8 @@ namespace {
|
| int FillInRawName(const std::string& encoding,
|
| std::vector<FtpDirectoryListingEntry>* entries) {
|
| for (size_t i = 0; i < entries->size(); i++) {
|
| - if (!base::UTF16ToCodepage(entries->at(i).name, encoding.c_str(),
|
| + if (!base::UTF16ToCodepage(entries->at(i).name,
|
| + encoding.c_str(),
|
| base::OnStringConversionError::FAIL,
|
| &entries->at(i).raw_name)) {
|
| return ERR_ENCODING_CONVERSION_FAILED;
|
| @@ -54,28 +55,15 @@ int ParseListing(const base::string16& text,
|
| base::Callback<bool(void)> callback;
|
| FtpServerType server_type;
|
| } parsers[] = {
|
| - {
|
| - base::Bind(&ParseFtpDirectoryListingLs, lines, current_time, entries),
|
| - SERVER_LS
|
| - },
|
| - {
|
| - base::Bind(&ParseFtpDirectoryListingWindows, lines, entries),
|
| - SERVER_WINDOWS
|
| - },
|
| - {
|
| - base::Bind(&ParseFtpDirectoryListingVms, lines, entries),
|
| - SERVER_VMS
|
| - },
|
| - {
|
| - base::Bind(&ParseFtpDirectoryListingNetware,
|
| - lines, current_time, entries),
|
| - SERVER_NETWARE
|
| - },
|
| - {
|
| - base::Bind(&ParseFtpDirectoryListingOS2, lines, entries),
|
| - SERVER_OS2
|
| - }
|
| - };
|
| + {base::Bind(&ParseFtpDirectoryListingLs, lines, current_time, entries),
|
| + SERVER_LS},
|
| + {base::Bind(&ParseFtpDirectoryListingWindows, lines, entries),
|
| + SERVER_WINDOWS},
|
| + {base::Bind(&ParseFtpDirectoryListingVms, lines, entries), SERVER_VMS},
|
| + {base::Bind(
|
| + &ParseFtpDirectoryListingNetware, lines, current_time, entries),
|
| + SERVER_NETWARE},
|
| + {base::Bind(&ParseFtpDirectoryListingOS2, lines, entries), SERVER_OS2}};
|
|
|
| for (size_t i = 0; i < ARRAYSIZE_UNSAFE(parsers); i++) {
|
| entries->clear();
|
| @@ -95,7 +83,7 @@ int DecodeAndParse(const std::string& text,
|
| const base::Time& current_time,
|
| std::vector<FtpDirectoryListingEntry>* entries,
|
| FtpServerType* server_type) {
|
| - const char* kNewlineSeparators[] = { "\n", "\r\n" };
|
| + const char* kNewlineSeparators[] = {"\n", "\r\n"};
|
|
|
| std::vector<std::string> encodings;
|
| if (!base::DetectAllEncodings(text, &encodings))
|
| @@ -128,9 +116,7 @@ int DecodeAndParse(const std::string& text,
|
|
|
| } // namespace
|
|
|
| -FtpDirectoryListingEntry::FtpDirectoryListingEntry()
|
| - : type(UNKNOWN),
|
| - size(-1) {
|
| +FtpDirectoryListingEntry::FtpDirectoryListingEntry() : type(UNKNOWN), size(-1) {
|
| }
|
|
|
| int ParseFtpDirectoryListing(const std::string& text,
|
|
|