Chromium Code Reviews| 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 #include <stddef.h> | |
|
grt (UTC plus 2)
2015/11/03 21:32:50
unused
fdoray
2015/11/03 22:09:16
Done.
| |
| 12 | |
| 13 namespace base { | |
| 14 class FilePath; | |
| 15 } | |
| 16 | |
| 17 // Reads |file_path| to avoid touching the disk when the file is actually used. | |
| 18 // The function checks the Windows version to determine which pre-reading | |
| 19 // mechanism to use. On Vista+, chunks of |step_size| bytes are read into a | |
| 20 // buffer. The bigger |step_size| is, the faster the file is pre-read (up to | |
| 21 // about 4MB according to local tests), but also the more memory is allocated | |
| 22 // for the buffer. | |
| 23 bool PreReadFile(const base::FilePath& file_path, int step_size); | |
| 24 | |
| 25 #endif // CHROME_APP_FILE_PRE_READER_WIN_H_ | |
| OLD | NEW |