| 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 <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 DCHECK(delegate_); | 74 DCHECK(delegate_); |
| 75 DCHECK(!dir.value().empty()); | 75 DCHECK(!dir.value().empty()); |
| 76 } | 76 } |
| 77 | 77 |
| 78 DirectoryLister::~DirectoryLister() { | 78 DirectoryLister::~DirectoryLister() { |
| 79 Cancel(); | 79 Cancel(); |
| 80 } | 80 } |
| 81 | 81 |
| 82 void DirectoryLister::Start() { | 82 void DirectoryLister::Start() { |
| 83 base::PostTaskWithTraits( | 83 base::PostTaskWithTraits( |
| 84 FROM_HERE, base::TaskTraits().MayBlock().WithShutdownBehavior( | 84 FROM_HERE, |
| 85 base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN), | 85 {base::MayBlock(), base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN}, |
| 86 base::Bind(&Core::Start, core_)); | 86 base::Bind(&Core::Start, core_)); |
| 87 } | 87 } |
| 88 | 88 |
| 89 void DirectoryLister::Cancel() { | 89 void DirectoryLister::Cancel() { |
| 90 core_->CancelOnOriginThread(); | 90 core_->CancelOnOriginThread(); |
| 91 } | 91 } |
| 92 | 92 |
| 93 DirectoryLister::Core::Core(const base::FilePath& dir, | 93 DirectoryLister::Core::Core(const base::FilePath& dir, |
| 94 ListingType type, | 94 ListingType type, |
| 95 DirectoryLister* lister) | 95 DirectoryLister* lister) |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 | 193 |
| 194 void DirectoryLister::OnListFile(const DirectoryListerData& data) { | 194 void DirectoryLister::OnListFile(const DirectoryListerData& data) { |
| 195 delegate_->OnListFile(data); | 195 delegate_->OnListFile(data); |
| 196 } | 196 } |
| 197 | 197 |
| 198 void DirectoryLister::OnListDone(int error) { | 198 void DirectoryLister::OnListDone(int error) { |
| 199 delegate_->OnListDone(error); | 199 delegate_->OnListDone(error); |
| 200 } | 200 } |
| 201 | 201 |
| 202 } // namespace net | 202 } // namespace net |
| OLD | NEW |