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

Side by Side Diff: net/ftp/ftp_directory_listing_parser_ls.cc

Issue 1535363003: Switch to standard integer types in net/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: stddef Created 5 years 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 unified diff | Download patch
« no previous file with comments | « net/ftp/ftp_directory_listing_parser.h ('k') | net/ftp/ftp_directory_listing_parser_unittest.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/ftp/ftp_directory_listing_parser_ls.h" 5 #include "net/ftp/ftp_directory_listing_parser_ls.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/strings/string_split.h" 10 #include "base/strings/string_split.h"
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 // (n is an integer). Allow such a line, but only once, and only if it's 138 // (n is an integer). Allow such a line, but only once, and only if it's
139 // the first non-empty line. Do not match the word exactly, because it may 139 // the first non-empty line. Do not match the word exactly, because it may
140 // be in different languages (at least English and German have been seen 140 // be in different languages (at least English and German have been seen
141 // in the field). 141 // in the field).
142 if (columns.size() == 2 && !received_total_line) { 142 if (columns.size() == 2 && !received_total_line) {
143 received_total_line = true; 143 received_total_line = true;
144 144
145 // Some FTP servers incorrectly return a negative integer for "n". Since 145 // Some FTP servers incorrectly return a negative integer for "n". Since
146 // this value is ignored anyway, just check any valid integer was 146 // this value is ignored anyway, just check any valid integer was
147 // provided. 147 // provided.
148 int64 total_number; 148 int64_t total_number;
149 if (!base::StringToInt64(columns[1], &total_number)) 149 if (!base::StringToInt64(columns[1], &total_number))
150 return false; 150 return false;
151 151
152 continue; 152 continue;
153 } 153 }
154 154
155 FtpDirectoryListingEntry entry; 155 FtpDirectoryListingEntry entry;
156 156
157 size_t column_offset; 157 size_t column_offset;
158 base::string16 size; 158 base::string16 size;
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 entry.name = entry.name.substr(0, pos); 222 entry.name = entry.name.substr(0, pos);
223 } 223 }
224 224
225 entries->push_back(entry); 225 entries->push_back(entry);
226 } 226 }
227 227
228 return true; 228 return true;
229 } 229 }
230 230
231 } // namespace net 231 } // namespace net
OLDNEW
« no previous file with comments | « net/ftp/ftp_directory_listing_parser.h ('k') | net/ftp/ftp_directory_listing_parser_unittest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698