| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 | 370 |
| 371 file_util::FileEnumerator file_enum( | 371 file_util::FileEnumerator file_enum( |
| 372 file_path_, false, static_cast<file_util::FileEnumerator::FILE_TYPE>( | 372 file_path_, false, static_cast<file_util::FileEnumerator::FILE_TYPE>( |
| 373 file_util::FileEnumerator::FILES | | 373 file_util::FileEnumerator::FILES | |
| 374 file_util::FileEnumerator::DIRECTORIES)); | 374 file_util::FileEnumerator::DIRECTORIES)); |
| 375 FilePath current; | 375 FilePath current; |
| 376 while (!(current = file_enum.Next()).empty()) { | 376 while (!(current = file_enum.Next()).empty()) { |
| 377 base::file_util_proxy::Entry entry; | 377 base::file_util_proxy::Entry entry; |
| 378 file_util::FileEnumerator::FindInfo info; | 378 file_util::FileEnumerator::FindInfo info; |
| 379 file_enum.GetFindInfo(&info); | 379 file_enum.GetFindInfo(&info); |
| 380 entry.isDirectory = file_enum.IsDirectory(info); | 380 entry.is_directory = file_enum.IsDirectory(info); |
| 381 // This will just give the entry's name instead of entire path | 381 // This will just give the entry's name instead of entire path |
| 382 // if we use current.value(). | 382 // if we use current.value(). |
| 383 entry.name = file_util::FileEnumerator::GetFilename(info).value(); | 383 entry.name = file_util::FileEnumerator::GetFilename(info).value(); |
| 384 entries_.push_back(entry); | 384 entries_.push_back(entry); |
| 385 } | 385 } |
| 386 } | 386 } |
| 387 | 387 |
| 388 virtual void RunCallback() { | 388 virtual void RunCallback() { |
| 389 callback_->Run(error_code(), entries_); | 389 callback_->Run(error_code(), entries_); |
| 390 delete callback_; | 390 delete callback_; |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 519 // static | 519 // static |
| 520 bool FileUtilProxy::RecursiveDelete( | 520 bool FileUtilProxy::RecursiveDelete( |
| 521 scoped_refptr<MessageLoopProxy> message_loop_proxy, | 521 scoped_refptr<MessageLoopProxy> message_loop_proxy, |
| 522 const FilePath& file_path, | 522 const FilePath& file_path, |
| 523 StatusCallback* callback) { | 523 StatusCallback* callback) { |
| 524 return Start(FROM_HERE, message_loop_proxy, | 524 return Start(FROM_HERE, message_loop_proxy, |
| 525 new RelayDelete(file_path, true, callback)); | 525 new RelayDelete(file_path, true, callback)); |
| 526 } | 526 } |
| 527 | 527 |
| 528 } // namespace base | 528 } // namespace base |
| OLD | NEW |