| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "net/base/directory_lister.h" | 5 #include "net/base/directory_lister.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 message_loop_(NULL), | 105 message_loop_(NULL), |
| 106 thread_(kNullThreadHandle) { | 106 thread_(kNullThreadHandle) { |
| 107 DCHECK(!dir.value().empty()); | 107 DCHECK(!dir.value().empty()); |
| 108 } | 108 } |
| 109 | 109 |
| 110 DirectoryLister::DirectoryLister(const FilePath& dir, | 110 DirectoryLister::DirectoryLister(const FilePath& dir, |
| 111 bool recursive, | 111 bool recursive, |
| 112 SORT_TYPE sort, | 112 SORT_TYPE sort, |
| 113 DirectoryListerDelegate* delegate) | 113 DirectoryListerDelegate* delegate) |
| 114 : dir_(dir), | 114 : dir_(dir), |
| 115 recursive_(false), | 115 recursive_(recursive), |
| 116 delegate_(delegate), | 116 delegate_(delegate), |
| 117 sort_(sort), | 117 sort_(sort), |
| 118 message_loop_(NULL), | 118 message_loop_(NULL), |
| 119 thread_(kNullThreadHandle) { | 119 thread_(kNullThreadHandle) { |
| 120 DCHECK(!dir.value().empty()); | 120 DCHECK(!dir.value().empty()); |
| 121 } | 121 } |
| 122 | 122 |
| 123 DirectoryLister::~DirectoryLister() { | 123 DirectoryLister::~DirectoryLister() { |
| 124 if (thread_) { | 124 if (thread_) { |
| 125 PlatformThread::Join(thread_); | 125 PlatformThread::Join(thread_); |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 // If canceled is set, we need to report some kind of error, | 223 // If canceled is set, we need to report some kind of error, |
| 224 // but don't overwrite the error condition if it is already set. | 224 // but don't overwrite the error condition if it is already set. |
| 225 if (!error && canceled_.IsSet()) | 225 if (!error && canceled_.IsSet()) |
| 226 error = net::ERR_ABORTED; | 226 error = net::ERR_ABORTED; |
| 227 | 227 |
| 228 if (delegate_) | 228 if (delegate_) |
| 229 delegate_->OnListDone(error); | 229 delegate_->OnListDone(error); |
| 230 } | 230 } |
| 231 | 231 |
| 232 } // namespace net | 232 } // namespace net |
| OLD | NEW |