OLD | NEW |
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 "base/file_util_proxy.h" | 5 #include "base/file_util_proxy.h" |
6 | 6 |
7 #include "base/message_loop_proxy.h" | 7 #include "base/message_loop_proxy.h" |
8 | 8 |
9 // TODO(jianli): Move the code from anonymous namespace to base namespace so | 9 // TODO(jianli): Move the code from anonymous namespace to base namespace so |
10 // that all of the base:: prefixes would be unnecessary. | 10 // that all of the base:: prefixes would be unnecessary. |
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
444 file_util::FileEnumerator::DIRECTORIES)); | 444 file_util::FileEnumerator::DIRECTORIES)); |
445 FilePath current; | 445 FilePath current; |
446 while (!(current = file_enum.Next()).empty()) { | 446 while (!(current = file_enum.Next()).empty()) { |
447 base::FileUtilProxy::Entry entry; | 447 base::FileUtilProxy::Entry entry; |
448 file_util::FileEnumerator::FindInfo info; | 448 file_util::FileEnumerator::FindInfo info; |
449 file_enum.GetFindInfo(&info); | 449 file_enum.GetFindInfo(&info); |
450 entry.is_directory = file_enum.IsDirectory(info); | 450 entry.is_directory = file_enum.IsDirectory(info); |
451 // This will just give the entry's name instead of entire path | 451 // This will just give the entry's name instead of entire path |
452 // if we use current.value(). | 452 // if we use current.value(). |
453 entry.name = file_util::FileEnumerator::GetFilename(info).value(); | 453 entry.name = file_util::FileEnumerator::GetFilename(info).value(); |
| 454 entry.size = file_util::FileEnumerator::GetFilesize(info); |
| 455 entry.last_modified_time = |
| 456 file_util::FileEnumerator::GetLastModifiedTime(info); |
454 entries_.push_back(entry); | 457 entries_.push_back(entry); |
455 } | 458 } |
456 } | 459 } |
457 | 460 |
458 virtual void RunCallback() { | 461 virtual void RunCallback() { |
459 callback_->Run(error_code(), entries_); | 462 callback_->Run(error_code(), entries_); |
460 delete callback_; | 463 delete callback_; |
461 } | 464 } |
462 | 465 |
463 private: | 466 private: |
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
913 | 916 |
914 // static | 917 // static |
915 bool FileUtilProxy::Flush( | 918 bool FileUtilProxy::Flush( |
916 scoped_refptr<MessageLoopProxy> message_loop_proxy, | 919 scoped_refptr<MessageLoopProxy> message_loop_proxy, |
917 PlatformFile file, | 920 PlatformFile file, |
918 StatusCallback* callback) { | 921 StatusCallback* callback) { |
919 return Start(FROM_HERE, message_loop_proxy, new RelayFlush(file, callback)); | 922 return Start(FROM_HERE, message_loop_proxy, new RelayFlush(file, callback)); |
920 } | 923 } |
921 | 924 |
922 } // namespace base | 925 } // namespace base |
OLD | NEW |