OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 : dir_(dir), | 164 : dir_(dir), |
165 recursive_(recursive), | 165 recursive_(recursive), |
166 sort_(sort), | 166 sort_(sort), |
167 lister_(lister) { | 167 lister_(lister) { |
168 DCHECK(lister_); | 168 DCHECK(lister_); |
169 } | 169 } |
170 | 170 |
171 DirectoryLister::Core::~Core() {} | 171 DirectoryLister::Core::~Core() {} |
172 | 172 |
173 bool DirectoryLister::Core::Start() { | 173 bool DirectoryLister::Core::Start() { |
174 origin_loop_ = base::MessageLoopProxy::CreateForCurrentThread(); | 174 origin_loop_ = base::MessageLoopProxy::current(); |
175 | 175 |
176 return base::WorkerPool::PostTask( | 176 return base::WorkerPool::PostTask( |
177 FROM_HERE, NewRunnableMethod(this, &Core::StartInternal), true); | 177 FROM_HERE, NewRunnableMethod(this, &Core::StartInternal), true); |
178 } | 178 } |
179 | 179 |
180 void DirectoryLister::Core::Cancel() { | 180 void DirectoryLister::Core::Cancel() { |
181 lister_ = NULL; | 181 lister_ = NULL; |
182 } | 182 } |
183 | 183 |
184 void DirectoryLister::Core::StartInternal() { | 184 void DirectoryLister::Core::StartInternal() { |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 | 241 |
242 void DirectoryLister::OnReceivedData(const DirectoryListerData& data) { | 242 void DirectoryLister::OnReceivedData(const DirectoryListerData& data) { |
243 delegate_->OnListFile(data); | 243 delegate_->OnListFile(data); |
244 } | 244 } |
245 | 245 |
246 void DirectoryLister::OnDone(int error) { | 246 void DirectoryLister::OnDone(int error) { |
247 delegate_->OnListDone(error); | 247 delegate_->OnListDone(error); |
248 } | 248 } |
249 | 249 |
250 } // namespace net | 250 } // namespace net |
OLD | NEW |