diff options
author | fdoray <fdoray@chromium.org> | 2015-10-30 11:44:39 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-10-30 18:45:42 +0000 |
commit | 2c32fabc2c602ee66bc63f9aec180ae60612302d (patch) | |
tree | 36ccb144f66f6f0f2e46243cd5a4b9bcaf37a760 /base/files | |
parent | 4e9288c70c1953c5f17bba476bd10679627519f4 (diff) | |
download | chromium_src-2c32fabc2c602ee66bc63f9aec180ae60612302d.zip chromium_src-2c32fabc2c602ee66bc63f9aec180ae60612302d.tar.gz chromium_src-2c32fabc2c602ee66bc63f9aec180ae60612302d.tar.bz2 |
Support Windows FILE_FLAG_SEQUENTIAL_SCAN in base::File.
FILE_FLAG_SEQUENTIAL_SCAN is a hint to the system that a file will be
read sequentially from beginning to end.
It is required to pre-read modules efficiently.
BUG=547794
Review URL: https://codereview.chromium.org/1424943006
Cr-Commit-Position: refs/heads/master@{#357151}
Diffstat (limited to 'base/files')
-rw-r--r-- | base/files/file.h | 1 | ||||
-rw-r--r-- | base/files/file_win.cc | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/base/files/file.h b/base/files/file.h index 8b3934d..66b78fa 100644 --- a/base/files/file.h +++ b/base/files/file.h @@ -85,6 +85,7 @@ class BASE_EXPORT File { FLAG_TERMINAL_DEVICE = 1 << 16, // Serial port flags. FLAG_BACKUP_SEMANTICS = 1 << 17, // Used on Windows only. FLAG_EXECUTE = 1 << 18, // Used on Windows only. + FLAG_SEQUENTIAL_SCAN = 1 << 19, // Used on Windows only. }; // This enum has been recorded in multiple histograms. If the order of the diff --git a/base/files/file_win.cc b/base/files/file_win.cc index ce38d0b..2d75ca2 100644 --- a/base/files/file_win.cc +++ b/base/files/file_win.cc @@ -375,6 +375,8 @@ void File::DoInitialize(const FilePath& path, uint32 flags) { create_flags |= FILE_FLAG_DELETE_ON_CLOSE; if (flags & FLAG_BACKUP_SEMANTICS) create_flags |= FILE_FLAG_BACKUP_SEMANTICS; + if (flags & FLAG_SEQUENTIAL_SCAN) + create_flags |= FILE_FLAG_SEQUENTIAL_SCAN; file_.Set(CreateFile(path.value().c_str(), access, sharing, NULL, disposition, create_flags, NULL)); |