| 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 "base/file_util.h" | 5 #include "base/file_util.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 #include <propvarutil.h> | 8 #include <propvarutil.h> |
| 9 #include <psapi.h> | 9 #include <psapi.h> |
| 10 #include <shellapi.h> | 10 #include <shellapi.h> |
| (...skipping 813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 824 | 824 |
| 825 FileEnumerator::FileEnumerator(const FilePath& root_path, | 825 FileEnumerator::FileEnumerator(const FilePath& root_path, |
| 826 bool recursive, | 826 bool recursive, |
| 827 FileType file_type) | 827 FileType file_type) |
| 828 : recursive_(recursive), | 828 : recursive_(recursive), |
| 829 file_type_(file_type), | 829 file_type_(file_type), |
| 830 has_find_data_(false), | 830 has_find_data_(false), |
| 831 find_handle_(INVALID_HANDLE_VALUE) { | 831 find_handle_(INVALID_HANDLE_VALUE) { |
| 832 // INCLUDE_DOT_DOT must not be specified if recursive. | 832 // INCLUDE_DOT_DOT must not be specified if recursive. |
| 833 DCHECK(!(recursive && (INCLUDE_DOT_DOT & file_type_))); | 833 DCHECK(!(recursive && (INCLUDE_DOT_DOT & file_type_))); |
| 834 memset(&find_data_, 0, sizeof(find_data_)); |
| 834 pending_paths_.push(root_path); | 835 pending_paths_.push(root_path); |
| 835 } | 836 } |
| 836 | 837 |
| 837 FileEnumerator::FileEnumerator(const FilePath& root_path, | 838 FileEnumerator::FileEnumerator(const FilePath& root_path, |
| 838 bool recursive, | 839 bool recursive, |
| 839 FileType file_type, | 840 FileType file_type, |
| 840 const FilePath::StringType& pattern) | 841 const FilePath::StringType& pattern) |
| 841 : recursive_(recursive), | 842 : recursive_(recursive), |
| 842 file_type_(file_type), | 843 file_type_(file_type), |
| 843 has_find_data_(false), | 844 has_find_data_(false), |
| 844 pattern_(pattern), | 845 pattern_(pattern), |
| 845 find_handle_(INVALID_HANDLE_VALUE) { | 846 find_handle_(INVALID_HANDLE_VALUE) { |
| 846 // INCLUDE_DOT_DOT must not be specified if recursive. | 847 // INCLUDE_DOT_DOT must not be specified if recursive. |
| 847 DCHECK(!(recursive && (INCLUDE_DOT_DOT & file_type_))); | 848 DCHECK(!(recursive && (INCLUDE_DOT_DOT & file_type_))); |
| 849 memset(&find_data_, 0, sizeof(find_data_)); |
| 848 pending_paths_.push(root_path); | 850 pending_paths_.push(root_path); |
| 849 } | 851 } |
| 850 | 852 |
| 851 FileEnumerator::~FileEnumerator() { | 853 FileEnumerator::~FileEnumerator() { |
| 852 if (find_handle_ != INVALID_HANDLE_VALUE) | 854 if (find_handle_ != INVALID_HANDLE_VALUE) |
| 853 FindClose(find_handle_); | 855 FindClose(find_handle_); |
| 854 } | 856 } |
| 855 | 857 |
| 856 void FileEnumerator::GetFindInfo(FindInfo* info) { | 858 void FileEnumerator::GetFindInfo(FindInfo* info) { |
| 857 DCHECK(info); | 859 DCHECK(info); |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1160 uint8 unused = *(touch + offset); | 1162 uint8 unused = *(touch + offset); |
| 1161 offset += step_size; | 1163 offset += step_size; |
| 1162 } | 1164 } |
| 1163 FreeLibrary(dll_module); | 1165 FreeLibrary(dll_module); |
| 1164 } | 1166 } |
| 1165 | 1167 |
| 1166 return true; | 1168 return true; |
| 1167 } | 1169 } |
| 1168 | 1170 |
| 1169 } // namespace file_util | 1171 } // namespace file_util |
| OLD | NEW |