| 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 "base/file_util.h" | 5 #include "base/file_util.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 #include <psapi.h> | 8 #include <psapi.h> |
| 9 #include <shellapi.h> | 9 #include <shellapi.h> |
| 10 #include <shlobj.h> | 10 #include <shlobj.h> |
| (...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 683 | 683 |
| 684 memcpy(info, &find_data_, sizeof(*info)); | 684 memcpy(info, &find_data_, sizeof(*info)); |
| 685 } | 685 } |
| 686 | 686 |
| 687 // static | 687 // static |
| 688 bool FileEnumerator::IsDirectory(const FindInfo& info) { | 688 bool FileEnumerator::IsDirectory(const FindInfo& info) { |
| 689 return (info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0; | 689 return (info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0; |
| 690 } | 690 } |
| 691 | 691 |
| 692 // static | 692 // static |
| 693 bool FileEnumerator::IsLink(const FindInfo& info) { | |
| 694 return false; | |
| 695 } | |
| 696 | |
| 697 // static | |
| 698 FilePath FileEnumerator::GetFilename(const FindInfo& find_info) { | 693 FilePath FileEnumerator::GetFilename(const FindInfo& find_info) { |
| 699 return FilePath(find_info.cFileName); | 694 return FilePath(find_info.cFileName); |
| 700 } | 695 } |
| 701 | 696 |
| 702 // static | 697 // static |
| 703 int64 FileEnumerator::GetFilesize(const FindInfo& find_info) { | 698 int64 FileEnumerator::GetFilesize(const FindInfo& find_info) { |
| 704 ULARGE_INTEGER size; | 699 ULARGE_INTEGER size; |
| 705 size.HighPart = find_info.nFileSizeHigh; | 700 size.HighPart = find_info.nFileSizeHigh; |
| 706 size.LowPart = find_info.nFileSizeLow; | 701 size.LowPart = find_info.nFileSizeLow; |
| 707 DCHECK_LE(size.QuadPart, std::numeric_limits<int64>::max()); | 702 DCHECK_LE(size.QuadPart, std::numeric_limits<int64>::max()); |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 967 HANDLE cp = GetCurrentProcess(); | 962 HANDLE cp = GetCurrentProcess(); |
| 968 if (::GetMappedFileNameW(cp, file_view, mapped_file_path, kMaxPathLength)) { | 963 if (::GetMappedFileNameW(cp, file_view, mapped_file_path, kMaxPathLength)) { |
| 969 *nt_path = FilePath(mapped_file_path); | 964 *nt_path = FilePath(mapped_file_path); |
| 970 success = true; | 965 success = true; |
| 971 } | 966 } |
| 972 ::UnmapViewOfFile(file_view); | 967 ::UnmapViewOfFile(file_view); |
| 973 return success; | 968 return success; |
| 974 } | 969 } |
| 975 | 970 |
| 976 } // namespace file_util | 971 } // namespace file_util |
| OLD | NEW |