Index: trunk/src/net/url_request/url_request_file_dir_job.cc |
=================================================================== |
--- trunk/src/net/url_request/url_request_file_dir_job.cc (revision 198849) |
+++ trunk/src/net/url_request/url_request_file_dir_job.cc (working copy) |
@@ -116,17 +116,27 @@ |
} |
#if defined(OS_WIN) |
- std::string raw_bytes; // Empty on Windows means UTF-8 encoded name. |
+ int64 size = (static_cast<unsigned __int64>(data.info.nFileSizeHigh) << 32) | |
+ data.info.nFileSizeLow; |
+ |
+ // Note that we should not convert ftLastWriteTime to the local time because |
+ // ICU's datetime formatting APIs expect time in UTC and take into account |
+ // the timezone before formatting. |
+ data_.append(GetDirectoryListingEntry( |
+ data.info.cFileName, |
+ std::string(), |
+ ((data.info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0), |
+ size, |
+ base::Time::FromFileTime(data.info.ftLastWriteTime))); |
#elif defined(OS_POSIX) |
// TOOD(jungshik): The same issue as for the directory name. |
- const std::string& raw_bytes = data.info.GetName().value(); |
+ data_.append(GetDirectoryListingEntry( |
+ WideToUTF16(base::SysNativeMBToWide(data.info.filename)), |
+ data.info.filename, |
+ S_ISDIR(data.info.stat.st_mode), |
+ data.info.stat.st_size, |
+ base::Time::FromTimeT(data.info.stat.st_mtime))); |
#endif |
- data_.append(GetDirectoryListingEntry( |
- data.info.GetName().LossyDisplayName(), |
- raw_bytes, |
- data.info.IsDirectory(), |
- data.info.GetSize(), |
- data.info.GetLastModifiedTime())); |
// TODO(darin): coalesce more? |
CompleteRead(); |