| OLD | NEW |
| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 base::SPLIT_WANT_ALL); | 45 base::SPLIT_WANT_ALL); |
| 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 local time. | 55 // We don't know the time zone of the server, so just use UTC. |
| 56 *result = base::Time::FromLocalExploded(time_exploded); | 56 *result = base::Time::FromUTCExploded(time_exploded); |
| 57 return true; | 57 return true; |
| 58 } | 58 } |
| 59 | 59 |
| 60 // Returns the column index of the end of the date listing and detected | 60 // Returns the column index of the end of the date listing and detected |
| 61 // last modification time. | 61 // last modification time. |
| 62 bool DetectColumnOffsetSizeAndModificationTime( | 62 bool DetectColumnOffsetSizeAndModificationTime( |
| 63 const std::vector<base::string16>& columns, | 63 const std::vector<base::string16>& columns, |
| 64 const base::Time& current_time, | 64 const base::Time& current_time, |
| 65 size_t* offset, | 65 size_t* offset, |
| 66 base::string16* size, | 66 base::string16* size, |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |
| OLD | NEW |