Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Side by Side Diff: net/base/directory_lister.cc

Issue 19052005: Move PathIsWritable, DirectoryExists, ContentsEqual, and TextContentsEqual to the base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « gpu/tools/compositor_model_bench/compositor_model_bench.cc ('k') | net/disk_cache/simple/simple_backend_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698