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

Side by Side Diff: webkit/fileapi/file_system_file_util.cc

Issue 7355013: Adding size and last modified time support to FileEnumerator and FileUtilProxy::Entry. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: '' Created 9 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "webkit/fileapi/file_system_file_util.h" 5 #include "webkit/fileapi/file_system_file_util.h"
6 6
7 #include <stack> 7 #include <stack>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/file_util_proxy.h" 10 #include "base/file_util_proxy.h"
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 file_util::FileEnumerator::DIRECTORIES)); 121 file_util::FileEnumerator::DIRECTORIES));
122 FilePath current; 122 FilePath current;
123 while (!(current = file_enum.Next()).empty()) { 123 while (!(current = file_enum.Next()).empty()) {
124 base::FileUtilProxy::Entry entry; 124 base::FileUtilProxy::Entry entry;
125 file_util::FileEnumerator::FindInfo info; 125 file_util::FileEnumerator::FindInfo info;
126 file_enum.GetFindInfo(&info); 126 file_enum.GetFindInfo(&info);
127 entry.is_directory = file_enum.IsDirectory(info); 127 entry.is_directory = file_enum.IsDirectory(info);
128 // This will just give the entry's name instead of entire path 128 // This will just give the entry's name instead of entire path
129 // if we use current.value(). 129 // if we use current.value().
130 entry.name = file_util::FileEnumerator::GetFilename(info).value(); 130 entry.name = file_util::FileEnumerator::GetFilename(info).value();
131 entry.size = file_util::FileEnumerator::GetFilesize(info);
132 entry.last_modified_time =
133 file_util::FileEnumerator::GetLastModifiedTime(info);
131 // TODO(rkc): Fix this also once we've refactored file_util 134 // TODO(rkc): Fix this also once we've refactored file_util
132 // http://code.google.com/p/chromium-os/issues/detail?id=15948 135 // http://code.google.com/p/chromium-os/issues/detail?id=15948
133 // This currently just prevents a file from showing up at all 136 // This currently just prevents a file from showing up at all
134 // if it's a link, hence preventing arbitary 'read' exploits. 137 // if it's a link, hence preventing arbitary 'read' exploits.
135 if (!file_util::IsLink(file_path.Append(entry.name))) 138 if (!file_util::IsLink(file_path.Append(entry.name)))
136 entries->push_back(entry); 139 entries->push_back(entry);
137 } 140 }
138 return base::PLATFORM_FILE_OK; 141 return base::PLATFORM_FILE_OK;
139 } 142 }
140 143
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after
544 FileSystemFileUtil::CreateFileEnumerator( 547 FileSystemFileUtil::CreateFileEnumerator(
545 FileSystemOperationContext* unused, 548 FileSystemOperationContext* unused,
546 const FilePath& root_path) { 549 const FilePath& root_path) {
547 return new FileSystemFileEnumerator( 550 return new FileSystemFileEnumerator(
548 root_path, true, static_cast<file_util::FileEnumerator::FILE_TYPE>( 551 root_path, true, static_cast<file_util::FileEnumerator::FILE_TYPE>(
549 file_util::FileEnumerator::FILES | 552 file_util::FileEnumerator::FILES |
550 file_util::FileEnumerator::DIRECTORIES)); 553 file_util::FileEnumerator::DIRECTORIES));
551 } 554 }
552 555
553 } // namespace fileapi 556 } // namespace fileapi
OLDNEW
« no previous file with comments | « webkit/fileapi/file_system_directory_database.h ('k') | webkit/fileapi/obfuscated_file_system_file_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698