| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef NET_BASE_DIRECTORY_LISTER_H_ | 5 #ifndef NET_BASE_DIRECTORY_LISTER_H_ |
| 6 #define NET_BASE_DIRECTORY_LISTER_H_ | 6 #define NET_BASE_DIRECTORY_LISTER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 // directory on the filesystem. It runs a task on a background thread, and | 25 // directory on the filesystem. It runs a task on a background thread, and |
| 26 // enumerates all files in the specified directory on that thread. Destroying | 26 // enumerates all files in the specified directory on that thread. Destroying |
| 27 // the lister cancels the list operation. The DirectoryLister must only be | 27 // the lister cancels the list operation. The DirectoryLister must only be |
| 28 // used on a thread with a MessageLoop. | 28 // used on a thread with a MessageLoop. |
| 29 class NET_EXPORT DirectoryLister { | 29 class NET_EXPORT DirectoryLister { |
| 30 public: | 30 public: |
| 31 // Represents one file found. | 31 // Represents one file found. |
| 32 struct DirectoryListerData { | 32 struct DirectoryListerData { |
| 33 base::FileEnumerator::FileInfo info; | 33 base::FileEnumerator::FileInfo info; |
| 34 base::FilePath path; | 34 base::FilePath path; |
| 35 base::FilePath absolute_path; |
| 35 }; | 36 }; |
| 36 | 37 |
| 37 // Implement this class to receive directory entries. | 38 // Implement this class to receive directory entries. |
| 38 class DirectoryListerDelegate { | 39 class DirectoryListerDelegate { |
| 39 public: | 40 public: |
| 40 // Called for each file found by the lister. | 41 // Called for each file found by the lister. |
| 41 virtual void OnListFile(const DirectoryListerData& data) = 0; | 42 virtual void OnListFile(const DirectoryListerData& data) = 0; |
| 42 | 43 |
| 43 // Called when the listing is complete. | 44 // Called when the listing is complete. |
| 44 virtual void OnListDone(int error) = 0; | 45 virtual void OnListDone(int error) = 0; |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 | 131 |
| 131 scoped_refptr<Core> core_; | 132 scoped_refptr<Core> core_; |
| 132 DirectoryListerDelegate* const delegate_; | 133 DirectoryListerDelegate* const delegate_; |
| 133 | 134 |
| 134 DISALLOW_COPY_AND_ASSIGN(DirectoryLister); | 135 DISALLOW_COPY_AND_ASSIGN(DirectoryLister); |
| 135 }; | 136 }; |
| 136 | 137 |
| 137 } // namespace net | 138 } // namespace net |
| 138 | 139 |
| 139 #endif // NET_BASE_DIRECTORY_LISTER_H_ | 140 #endif // NET_BASE_DIRECTORY_LISTER_H_ |
| OLD | NEW |