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

Side by Side Diff: base/file_util.h

Issue 9235053: Add a PartialPreReadImage function to file_util (on Windows). (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: make image_pre_reader project windows only Created 8 years, 10 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
« no previous file with comments | « no previous file | base/file_util_win.cc » ('j') | chrome/app/client_util.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // 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 597 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 size_t length_; 608 size_t length_;
609 609
610 DISALLOW_COPY_AND_ASSIGN(MemoryMappedFile); 610 DISALLOW_COPY_AND_ASSIGN(MemoryMappedFile);
611 }; 611 };
612 612
613 // Returns whether the file has been modified since a particular date. 613 // Returns whether the file has been modified since a particular date.
614 BASE_EXPORT bool HasFileBeenModifiedSince( 614 BASE_EXPORT bool HasFileBeenModifiedSince(
615 const FileEnumerator::FindInfo& find_info, 615 const FileEnumerator::FindInfo& find_info,
616 const base::Time& cutoff_time); 616 const base::Time& cutoff_time);
617 617
618 #if defined(OS_WIN)
619 // Loads the file passed in as an image section and touches pages to avoid
620 // subsequent hard page faults during LoadLibrary. The size to be pre read
621 // is passed in. If it is 0 then the whole file is paged in. The step size
622 // which indicates the number of bytes to skip after every page touched is
623 // also passed in.
624 bool BASE_EXPORT PreReadImage(const wchar_t* file_path, size_t size_to_read,
625 size_t step_size);
626 #endif // OS_WIN
627
628 #if defined(OS_LINUX) 618 #if defined(OS_LINUX)
629 // Broad categories of file systems as returned by statfs() on Linux. 619 // Broad categories of file systems as returned by statfs() on Linux.
630 enum FileSystemType { 620 enum FileSystemType {
631 FILE_SYSTEM_UNKNOWN, // statfs failed. 621 FILE_SYSTEM_UNKNOWN, // statfs failed.
632 FILE_SYSTEM_0, // statfs.f_type == 0 means unknown, may indicate AFS. 622 FILE_SYSTEM_0, // statfs.f_type == 0 means unknown, may indicate AFS.
633 FILE_SYSTEM_ORDINARY, // on-disk filesystem like ext2 623 FILE_SYSTEM_ORDINARY, // on-disk filesystem like ext2
634 FILE_SYSTEM_NFS, 624 FILE_SYSTEM_NFS,
635 FILE_SYSTEM_SMB, 625 FILE_SYSTEM_SMB,
636 FILE_SYSTEM_CODA, 626 FILE_SYSTEM_CODA,
637 FILE_SYSTEM_MEMORY, // in-memory file system 627 FILE_SYSTEM_MEMORY, // in-memory file system
638 FILE_SYSTEM_CGROUP, // cgroup control. 628 FILE_SYSTEM_CGROUP, // cgroup control.
639 FILE_SYSTEM_OTHER, // any other value. 629 FILE_SYSTEM_OTHER, // any other value.
640 FILE_SYSTEM_TYPE_COUNT 630 FILE_SYSTEM_TYPE_COUNT
641 }; 631 };
642 632
643 // Attempts determine the FileSystemType for |path|. 633 // Attempts determine the FileSystemType for |path|.
644 // Returns false if |path| doesn't exist. 634 // Returns false if |path| doesn't exist.
645 BASE_EXPORT bool GetFileSystemType(const FilePath& path, FileSystemType* type); 635 BASE_EXPORT bool GetFileSystemType(const FilePath& path, FileSystemType* type);
646 #endif 636 #endif
647 637
648 } // namespace file_util 638 } // namespace file_util
649 639
650 // Deprecated functions have been moved to this separate header file, 640 // Deprecated functions have been moved to this separate header file,
651 // which must be included last after all the above definitions. 641 // which must be included last after all the above definitions.
652 #include "base/file_util_deprecated.h" 642 #include "base/file_util_deprecated.h"
653 643
654 #endif // BASE_FILE_UTIL_H_ 644 #endif // BASE_FILE_UTIL_H_
OLDNEW
« no previous file with comments | « no previous file | base/file_util_win.cc » ('j') | chrome/app/client_util.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698