diff options
author | jshin@chromium.org <jshin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-20 19:04:58 +0000 |
---|---|---|
committer | jshin@chromium.org <jshin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-20 19:04:58 +0000 |
commit | a88fe98365b13a73e9d086ee4cdc6db54b9ad436 (patch) | |
tree | 5be8d9f96f43ae255f185e9fa2b253388753a339 | |
parent | 4fe5aeed0744a2ce69cc7024db1b876795f317b4 (diff) | |
download | chromium_src-a88fe98365b13a73e9d086ee4cdc6db54b9ad436.zip chromium_src-a88fe98365b13a73e9d086ee4cdc6db54b9ad436.tar.gz chromium_src-a88fe98365b13a73e9d086ee4cdc6db54b9ad436.tar.bz2 |
Merge 32566 - In the local file listing, we should pass time in UTC to ICU's date/time formatting apis instead of the localtime.
ICU apis take into account the timezone when formatting and expect to receive time in UTC.
This is an issue only on Windows. On Mac/Linux, we do the 'right thing'.
BUG=15304
TEST=1. Make a local file or two 2. Go to the directory in Chrome 3. The file modification date matches actual time you created the file (a moment ago) instead of being offset by the offset between your time zone and UTC.
Review URL: http://codereview.chromium.org/413002
TBR=jshin@chromium.org
Review URL: http://codereview.chromium.org/418015
git-svn-id: svn://svn.chromium.org/chrome/branches/249/src@32638 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | net/url_request/url_request_file_dir_job.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/net/url_request/url_request_file_dir_job.cc b/net/url_request/url_request_file_dir_job.cc index a933274..07977b5 100644 --- a/net/url_request/url_request_file_dir_job.cc +++ b/net/url_request/url_request_file_dir_job.cc @@ -122,16 +122,17 @@ void URLRequestFileDirJob::OnListFile( } #if defined(OS_WIN) - FILETIME local_time; - ::FileTimeToLocalFileTime(&data.ftLastWriteTime, &local_time); int64 size = (static_cast<unsigned __int64>(data.nFileSizeHigh) << 32) | data.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(net::GetDirectoryListingEntry( data.cFileName, std::string(), (data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ? true : false, size, - base::Time::FromFileTime(local_time))); + base::Time::FromFileTime(data.ftLastWriteTime))); #elif defined(OS_POSIX) // TOOD(jungshik): The same issue as for the directory name. |