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

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

Issue 2090713003: Make callers of FromUTC(Local)Exploded in net/ use new time API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: undo comment change Created 4 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
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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 if (time_parts.size() != 2) 46 if (time_parts.size() != 2)
47 return false; 47 return false;
48 if (!base::StringToInt(time_parts[0], &time_exploded.hour)) 48 if (!base::StringToInt(time_parts[0], &time_exploded.hour))
49 return false; 49 return false;
50 if (!base::StringToInt(time_parts[1], &time_exploded.minute)) 50 if (!base::StringToInt(time_parts[1], &time_exploded.minute))
51 return false; 51 return false;
52 if (!time_exploded.HasValidValues()) 52 if (!time_exploded.HasValidValues())
53 return false; 53 return false;
54 54
55 // We don't know the time zone of the server, so just use UTC. 55 // We don't know the time zone of the server, so just use UTC.
56 *result = base::Time::FromUTCExploded(time_exploded); 56 return base::Time::FromUTCExploded(time_exploded, result);
57 return true;
58 } 57 }
59 58
60 // Returns the column index of the end of the date listing and detected 59 // Returns the column index of the end of the date listing and detected
61 // last modification time. 60 // last modification time.
62 bool DetectColumnOffsetSizeAndModificationTime( 61 bool DetectColumnOffsetSizeAndModificationTime(
63 const std::vector<base::string16>& columns, 62 const std::vector<base::string16>& columns,
64 const base::Time& current_time, 63 const base::Time& current_time,
65 size_t* offset, 64 size_t* offset,
66 base::string16* size, 65 base::string16* size,
67 base::Time* modification_time) { 66 base::Time* modification_time) {
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 entry.name = entry.name.substr(0, pos); 221 entry.name = entry.name.substr(0, pos);
223 } 222 }
224 223
225 entries->push_back(entry); 224 entries->push_back(entry);
226 } 225 }
227 226
228 return true; 227 return true;
229 } 228 }
230 229
231 } // namespace net 230 } // namespace net
OLDNEW
« no previous file with comments | « net/extras/sqlite/sqlite_channel_id_store_unittest.cc ('k') | net/ftp/ftp_directory_listing_parser_unittest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698