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

Side by Side Diff: base/files/file_enumerator_win.cc

Issue 946183002: Add base_unittests to win8 trybot. Fix PEImage tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: namespace the callbacks Created 5 years, 9 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "base/files/file_enumerator.h" 5 #include "base/files/file_enumerator.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/threading/thread_restrictions.h" 10 #include "base/threading/thread_restrictions.h"
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 140
141 // Construct the absolute filename. 141 // Construct the absolute filename.
142 cur_file = root_path_.Append(find_data_.cFileName); 142 cur_file = root_path_.Append(find_data_.cFileName);
143 143
144 if (find_data_.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { 144 if (find_data_.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
145 if (recursive_) { 145 if (recursive_) {
146 // If |cur_file| is a directory, and we are doing recursive searching, 146 // If |cur_file| is a directory, and we are doing recursive searching,
147 // add it to pending_paths_ so we scan it after we finish scanning this 147 // add it to pending_paths_ so we scan it after we finish scanning this
148 // directory. However, don't do recursion through reparse points or we 148 // directory. However, don't do recursion through reparse points or we
149 // may end up with an infinite cycle. 149 // may end up with an infinite cycle.
150 if (!(find_data_.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT)) 150 DWORD attributes = GetFileAttributes(cur_file.value().c_str());
151 if (!(attributes & FILE_ATTRIBUTE_REPARSE_POINT))
151 pending_paths_.push(cur_file); 152 pending_paths_.push(cur_file);
152 } 153 }
153 if (file_type_ & FileEnumerator::DIRECTORIES) 154 if (file_type_ & FileEnumerator::DIRECTORIES)
154 return cur_file; 155 return cur_file;
155 } else if (file_type_ & FileEnumerator::FILES) { 156 } else if (file_type_ & FileEnumerator::FILES) {
156 return cur_file; 157 return cur_file;
157 } 158 }
158 } 159 }
159 160
160 return FilePath(); 161 return FilePath();
161 } 162 }
162 163
163 } // namespace base 164 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698