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

Unified Diff: net/url_request/url_request_file_dir_job.cc

Issue 16392011: Move FileEnumerator to its own file, do some refactoring. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix incorrect includes Created 7 years, 6 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/tools/quic/quic_in_memory_cache.cc ('k') | net/url_request/url_request_file_job.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request_file_dir_job.cc
diff --git a/net/url_request/url_request_file_dir_job.cc b/net/url_request/url_request_file_dir_job.cc
index cb10de42319d10c5b1fd07b89563a5f370bee3df..c522d9a5680504484199af8f7cc5a02f9455ad9b 100644
--- a/net/url_request/url_request_file_dir_job.cc
+++ b/net/url_request/url_request_file_dir_job.cc
@@ -116,27 +116,17 @@ void URLRequestFileDirJob::OnListFile(
}
#if defined(OS_WIN)
- 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)));
+ std::string raw_bytes; // Empty on Windows means UTF-8 encoded name.
#elif defined(OS_POSIX)
// TOOD(jungshik): The same issue as for the directory name.
- 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)));
+ const std::string& raw_bytes = data.info.GetName().value();
#endif
+ data_.append(GetDirectoryListingEntry(
+ data.info.GetName().LossyDisplayName(),
+ raw_bytes,
+ data.info.IsDirectory(),
+ data.info.GetSize(),
+ data.info.GetLastModifiedTime()));
// TODO(darin): coalesce more?
CompleteRead();
« no previous file with comments | « net/tools/quic/quic_in_memory_cache.cc ('k') | net/url_request/url_request_file_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698