OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 // This file defines a function to pre-read a file in order to avoid touching | |
6 // the disk when it is subsequently used. | |
7 | |
8 #ifndef CHROME_APP_FILE_PRE_READER_WIN_H_ | |
9 #define CHROME_APP_FILE_PRE_READER_WIN_H_ | |
10 | |
11 namespace base { | |
12 class FilePath; | |
13 } | |
14 | |
15 // Reads |file_path| to avoid touching the disk when the file is actually used. | |
16 // The function checks the Windows version to determine which pre-reading | |
17 // mechanism to use. On Vista+, chunks of |step_size| bytes are read into a | |
18 // buffer. The bigger |step_size| is, the faster the file is pre-read (up to | |
19 // about 4MB according to local tests), but also the more memory is allocated | |
20 // for the buffer. | |
21 bool PreReadFile(const base::FilePath& file_path, int step_size); | |
22 | |
23 #endif // CHROME_APP_FILE_PRE_READER_WIN_H_ | |
OLD | NEW |