Commit 2c32fabc authored by fdoray's avatar fdoray Committed by Commit bot

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}
parent 4e9288c7
...@@ -85,6 +85,7 @@ class BASE_EXPORT File { ...@@ -85,6 +85,7 @@ class BASE_EXPORT File {
FLAG_TERMINAL_DEVICE = 1 << 16, // Serial port flags. FLAG_TERMINAL_DEVICE = 1 << 16, // Serial port flags.
FLAG_BACKUP_SEMANTICS = 1 << 17, // Used on Windows only. FLAG_BACKUP_SEMANTICS = 1 << 17, // Used on Windows only.
FLAG_EXECUTE = 1 << 18, // 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 // This enum has been recorded in multiple histograms. If the order of the
......
...@@ -375,6 +375,8 @@ void File::DoInitialize(const FilePath& path, uint32 flags) { ...@@ -375,6 +375,8 @@ void File::DoInitialize(const FilePath& path, uint32 flags) {
create_flags |= FILE_FLAG_DELETE_ON_CLOSE; create_flags |= FILE_FLAG_DELETE_ON_CLOSE;
if (flags & FLAG_BACKUP_SEMANTICS) if (flags & FLAG_BACKUP_SEMANTICS)
create_flags |= FILE_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, file_.Set(CreateFile(path.value().c_str(), access, sharing, NULL,
disposition, create_flags, NULL)); disposition, create_flags, NULL));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment