| 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 #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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 // Call this method to asynchronously stop directory enumeration. The | 75 // Call this method to asynchronously stop directory enumeration. The |
| 76 // delegate will receive the OnListDone notification with an error code of | 76 // delegate will receive the OnListDone notification with an error code of |
| 77 // net::ERR_ABORTED. | 77 // net::ERR_ABORTED. |
| 78 void Cancel(); | 78 void Cancel(); |
| 79 | 79 |
| 80 // The delegate pointer may be modified at any time. | 80 // The delegate pointer may be modified at any time. |
| 81 DirectoryListerDelegate* delegate() const { return delegate_; } | 81 DirectoryListerDelegate* delegate() const { return delegate_; } |
| 82 void set_delegate(DirectoryListerDelegate* d) { delegate_ = d; } | 82 void set_delegate(DirectoryListerDelegate* d) { delegate_ = d; } |
| 83 | 83 |
| 84 // PlatformThread::Delegate implementation | 84 // PlatformThread::Delegate implementation |
| 85 void ThreadMain(); | 85 virtual void ThreadMain(); |
| 86 | 86 |
| 87 private: | 87 private: |
| 88 friend class base::RefCountedThreadSafe<DirectoryLister>; | 88 friend class base::RefCountedThreadSafe<DirectoryLister>; |
| 89 friend class DirectoryDataEvent; | 89 friend class DirectoryDataEvent; |
| 90 | 90 |
| 91 // Comparison methods for sorting, chosen based on |sort_|. | 91 // Comparison methods for sorting, chosen based on |sort_|. |
| 92 static bool CompareAlphaDirsFirst(const DirectoryListerData& a, | 92 static bool CompareAlphaDirsFirst(const DirectoryListerData& a, |
| 93 const DirectoryListerData& b); | 93 const DirectoryListerData& b); |
| 94 static bool CompareDate(const DirectoryListerData& a, | 94 static bool CompareDate(const DirectoryListerData& a, |
| 95 const DirectoryListerData& b); | 95 const DirectoryListerData& b); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 106 DirectoryListerDelegate* delegate_; | 106 DirectoryListerDelegate* delegate_; |
| 107 SORT_TYPE sort_; | 107 SORT_TYPE sort_; |
| 108 MessageLoop* message_loop_; | 108 MessageLoop* message_loop_; |
| 109 PlatformThreadHandle thread_; | 109 PlatformThreadHandle thread_; |
| 110 base::CancellationFlag canceled_; | 110 base::CancellationFlag canceled_; |
| 111 }; | 111 }; |
| 112 | 112 |
| 113 } // namespace net | 113 } // namespace net |
| 114 | 114 |
| 115 #endif // NET_BASE_DIRECTORY_LISTER_H_ | 115 #endif // NET_BASE_DIRECTORY_LISTER_H_ |
| OLD | NEW |