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 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 | 432 |
433 protected: | 433 protected: |
434 virtual void RunWork() { | 434 virtual void RunWork() { |
435 // TODO(kkanetkar): Implement directory read in multiple chunks. | 435 // TODO(kkanetkar): Implement directory read in multiple chunks. |
436 if (!file_util::DirectoryExists(file_path_)) { | 436 if (!file_util::DirectoryExists(file_path_)) { |
437 set_error_code(base::PLATFORM_FILE_ERROR_NOT_FOUND); | 437 set_error_code(base::PLATFORM_FILE_ERROR_NOT_FOUND); |
438 return; | 438 return; |
439 } | 439 } |
440 | 440 |
441 file_util::FileEnumerator file_enum( | 441 file_util::FileEnumerator file_enum( |
442 file_path_, false, static_cast<file_util::FileEnumerator::FILE_TYPE>( | 442 file_path_, false, static_cast<file_util::FileEnumerator::FileType>( |
443 file_util::FileEnumerator::FILES | | 443 file_util::FileEnumerator::FILES | |
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(). |
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
916 | 916 |
917 // static | 917 // static |
918 bool FileUtilProxy::Flush( | 918 bool FileUtilProxy::Flush( |
919 scoped_refptr<MessageLoopProxy> message_loop_proxy, | 919 scoped_refptr<MessageLoopProxy> message_loop_proxy, |
920 PlatformFile file, | 920 PlatformFile file, |
921 StatusCallback* callback) { | 921 StatusCallback* callback) { |
922 return Start(FROM_HERE, message_loop_proxy, new RelayFlush(file, callback)); | 922 return Start(FROM_HERE, message_loop_proxy, new RelayFlush(file, callback)); |
923 } | 923 } |
924 | 924 |
925 } // namespace base | 925 } // namespace base |
OLD | NEW |