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

Side by Side Diff: base/file_util_proxy.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
« no previous file with comments | « base/file_util_proxy.h ('k') | base/file_util_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "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
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
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
OLDNEW
« no previous file with comments | « base/file_util_proxy.h ('k') | base/file_util_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698