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 // This file contains utility functions for dealing with the local | 5 // This file contains utility functions for dealing with the local |
6 // filesystem. | 6 // filesystem. |
7 | 7 |
8 #ifndef BASE_FILE_UTIL_H_ | 8 #ifndef BASE_FILE_UTIL_H_ |
9 #define BASE_FILE_UTIL_H_ | 9 #define BASE_FILE_UTIL_H_ |
10 #pragma once | 10 #pragma once |
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
609 const base::Time& cutoff_time); | 609 const base::Time& cutoff_time); |
610 | 610 |
611 #if defined(OS_WIN) | 611 #if defined(OS_WIN) |
612 // Loads the file passed in as an image section and touches pages to avoid | 612 // Loads the file passed in as an image section and touches pages to avoid |
613 // subsequent hard page faults during LoadLibrary. The size to be pre read | 613 // subsequent hard page faults during LoadLibrary. The size to be pre read |
614 // is passed in. If it is 0 then the whole file is paged in. The step size | 614 // is passed in. If it is 0 then the whole file is paged in. The step size |
615 // which indicates the number of bytes to skip after every page touched is | 615 // which indicates the number of bytes to skip after every page touched is |
616 // also passed in. | 616 // also passed in. |
617 bool BASE_EXPORT PreReadImage(const wchar_t* file_path, size_t size_to_read, | 617 bool BASE_EXPORT PreReadImage(const wchar_t* file_path, size_t size_to_read, |
618 size_t step_size); | 618 size_t step_size); |
619 | |
620 bool BASE_EXPORT PartialPreReadImage(const wchar_t* file_path, | |
Sigurður Ásgeirsson
2012/01/26 18:59:20
A bit of documentation?
Roger McFarlane (Google)
2012/01/27 05:24:08
Oops. Done.
| |
621 size_t percentage, | |
622 size_t step_size); | |
619 #endif // OS_WIN | 623 #endif // OS_WIN |
620 | 624 |
621 #if defined(OS_LINUX) | 625 #if defined(OS_LINUX) |
622 // Broad categories of file systems as returned by statfs() on Linux. | 626 // Broad categories of file systems as returned by statfs() on Linux. |
623 enum FileSystemType { | 627 enum FileSystemType { |
624 FILE_SYSTEM_UNKNOWN, // statfs failed. | 628 FILE_SYSTEM_UNKNOWN, // statfs failed. |
625 FILE_SYSTEM_0, // statfs.f_type == 0 means unknown, may indicate AFS. | 629 FILE_SYSTEM_0, // statfs.f_type == 0 means unknown, may indicate AFS. |
626 FILE_SYSTEM_ORDINARY, // on-disk filesystem like ext2 | 630 FILE_SYSTEM_ORDINARY, // on-disk filesystem like ext2 |
627 FILE_SYSTEM_NFS, | 631 FILE_SYSTEM_NFS, |
628 FILE_SYSTEM_SMB, | 632 FILE_SYSTEM_SMB, |
629 FILE_SYSTEM_CODA, | 633 FILE_SYSTEM_CODA, |
630 FILE_SYSTEM_MEMORY, // in-memory file system | 634 FILE_SYSTEM_MEMORY, // in-memory file system |
631 FILE_SYSTEM_CGROUP, // cgroup control. | 635 FILE_SYSTEM_CGROUP, // cgroup control. |
632 FILE_SYSTEM_OTHER, // any other value. | 636 FILE_SYSTEM_OTHER, // any other value. |
633 FILE_SYSTEM_TYPE_COUNT | 637 FILE_SYSTEM_TYPE_COUNT |
634 }; | 638 }; |
635 | 639 |
636 // Attempts determine the FileSystemType for |path|. | 640 // Attempts determine the FileSystemType for |path|. |
637 // Returns false if |path| doesn't exist. | 641 // Returns false if |path| doesn't exist. |
638 BASE_EXPORT bool GetFileSystemType(const FilePath& path, FileSystemType* type); | 642 BASE_EXPORT bool GetFileSystemType(const FilePath& path, FileSystemType* type); |
639 #endif | 643 #endif |
640 | 644 |
641 } // namespace file_util | 645 } // namespace file_util |
642 | 646 |
643 // Deprecated functions have been moved to this separate header file, | 647 // Deprecated functions have been moved to this separate header file, |
644 // which must be included last after all the above definitions. | 648 // which must be included last after all the above definitions. |
645 #include "base/file_util_deprecated.h" | 649 #include "base/file_util_deprecated.h" |
646 | 650 |
647 #endif // BASE_FILE_UTIL_H_ | 651 #endif // BASE_FILE_UTIL_H_ |
OLD | NEW |