summaryrefslogtreecommitdiffstats
path: root/net/url_request
diff options
context:
space:
mode:
authorjohnnyg@chromium.org <johnnyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-21 23:25:22 +0000
committerjohnnyg@chromium.org <johnnyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-21 23:25:22 +0000
commit9ee2c8d83a4680bd6d78cbac7720170f602d42b1 (patch)
tree2cee50ea810d7e37431c99c0e3bdcb08f4ed3d12 /net/url_request
parentab8b3728e44decabaf5484eb93e5d4f9cfcd1efb (diff)
downloadchromium_src-9ee2c8d83a4680bd6d78cbac7720170f602d42b1.zip
chromium_src-9ee2c8d83a4680bd6d78cbac7720170f602d42b1.tar.gz
chromium_src-9ee2c8d83a4680bd6d78cbac7720170f602d42b1.tar.bz2
Allow net::DirectoryLister to be used to recursively list the directory, and add a FULL_PATH sort option.
BUG=41762 TEST=unit test Review URL: http://codereview.chromium.org/3175023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57005 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/url_request')
-rw-r--r--net/url_request/url_request_file_dir_job.cc22
-rw-r--r--net/url_request/url_request_file_dir_job.h3
2 files changed, 13 insertions, 12 deletions
diff --git a/net/url_request/url_request_file_dir_job.cc b/net/url_request/url_request_file_dir_job.cc
index 19a1aaf..23ff6ff 100644
--- a/net/url_request/url_request_file_dir_job.cc
+++ b/net/url_request/url_request_file_dir_job.cc
@@ -102,7 +102,7 @@ bool URLRequestFileDirJob::GetCharset(string* charset) {
}
void URLRequestFileDirJob::OnListFile(
- const file_util::FileEnumerator::FindInfo& data) {
+ const net::DirectoryLister::DirectoryListerData& data) {
// We wait to write out the header until we get the first file, so that we
// can catch errors from DirectoryLister and show an error page.
if (!wrote_header_) {
@@ -122,26 +122,26 @@ void URLRequestFileDirJob::OnListFile(
}
#if defined(OS_WIN)
- int64 size = (static_cast<unsigned __int64>(data.nFileSizeHigh) << 32) |
- data.nFileSizeLow;
+ 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(net::GetDirectoryListingEntry(
- data.cFileName, std::string(),
- (data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ? true : false,
+ data.info.cFileName, std::string(),
+ (data.info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ? true : false,
size,
- base::Time::FromFileTime(data.ftLastWriteTime)));
+ base::Time::FromFileTime(data.info.ftLastWriteTime)));
#elif defined(OS_POSIX)
// TOOD(jungshik): The same issue as for the directory name.
data_.append(net::GetDirectoryListingEntry(
- WideToUTF16(base::SysNativeMBToWide(data.filename)),
- data.filename,
- S_ISDIR(data.stat.st_mode),
- data.stat.st_size,
- base::Time::FromTimeT(data.stat.st_mtime)));
+ 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
// TODO(darin): coalesce more?
diff --git a/net/url_request/url_request_file_dir_job.h b/net/url_request/url_request_file_dir_job.h
index 863d5a9..c78de97 100644
--- a/net/url_request/url_request_file_dir_job.h
+++ b/net/url_request/url_request_file_dir_job.h
@@ -28,7 +28,8 @@ class URLRequestFileDirJob
virtual bool GetCharset(std::string* charset);
// DirectoryLister::DirectoryListerDelegate methods:
- virtual void OnListFile(const file_util::FileEnumerator::FindInfo& data);
+ virtual void OnListFile(
+ const net::DirectoryLister::DirectoryListerData& data);
virtual void OnListDone(int error);
bool list_complete() const { return list_complete_; }