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 #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/bind.h" | 10 #include "base/bind.h" |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 return base::WorkerPool::PostTask( | 136 return base::WorkerPool::PostTask( |
137 FROM_HERE, base::Bind(&Core::StartInternal, this), true); | 137 FROM_HERE, base::Bind(&Core::StartInternal, this), true); |
138 } | 138 } |
139 | 139 |
140 void DirectoryLister::Core::Cancel() { | 140 void DirectoryLister::Core::Cancel() { |
141 lister_ = NULL; | 141 lister_ = NULL; |
142 } | 142 } |
143 | 143 |
144 void DirectoryLister::Core::StartInternal() { | 144 void DirectoryLister::Core::StartInternal() { |
145 | 145 |
146 if (!file_util::DirectoryExists(dir_)) { | 146 if (!base::DirectoryExists(dir_)) { |
147 origin_loop_->PostTask( | 147 origin_loop_->PostTask( |
148 FROM_HERE, | 148 FROM_HERE, |
149 base::Bind(&DirectoryLister::Core::OnDone, this, ERR_FILE_NOT_FOUND)); | 149 base::Bind(&DirectoryLister::Core::OnDone, this, ERR_FILE_NOT_FOUND)); |
150 return; | 150 return; |
151 } | 151 } |
152 | 152 |
153 int types = base::FileEnumerator::FILES | base::FileEnumerator::DIRECTORIES; | 153 int types = base::FileEnumerator::FILES | base::FileEnumerator::DIRECTORIES; |
154 if (!recursive_) | 154 if (!recursive_) |
155 types |= base::FileEnumerator::INCLUDE_DOT_DOT; | 155 types |= base::FileEnumerator::INCLUDE_DOT_DOT; |
156 | 156 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 | 206 |
207 void DirectoryLister::OnReceivedData(const DirectoryListerData& data) { | 207 void DirectoryLister::OnReceivedData(const DirectoryListerData& data) { |
208 delegate_->OnListFile(data); | 208 delegate_->OnListFile(data); |
209 } | 209 } |
210 | 210 |
211 void DirectoryLister::OnDone(int error) { | 211 void DirectoryLister::OnDone(int error) { |
212 delegate_->OnListDone(error); | 212 delegate_->OnListDone(error); |
213 } | 213 } |
214 | 214 |
215 } // namespace net | 215 } // namespace net |
OLD | NEW |