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> | |
| 12 | |
| 13 #include "base/files/file_path.h" | |
|
grt (UTC plus 2)
2015/11/03 04:02:15
forward declare class FilePath (http://www.chromiu
fdoray
2015/11/03 21:23:39
Done.
| |
| 14 | |
| 15 // Reads the file passed in to avoid touching the disk when the file is actually | |
|
grt (UTC plus 2)
2015/11/03 04:02:15
nit: "Reads |file_path| to avoid..."
fdoray
2015/11/03 21:23:39
Done.
| |
| 16 // used. 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 | |
|
fdoray
2015/10/30 21:08:54
I plan to do a Canary experiment to find the best
| |
| 20 // for the buffer. | |
| 21 bool PreReadFile(const base::FilePath& file_path, size_t step_size); | |
|
grt (UTC plus 2)
2015/11/03 04:02:15
size_t -> int as per .cc file
fdoray
2015/11/03 21:23:39
Done.
| |
| 22 | |
| 23 #endif // CHROME_APP_FILE_PRE_READER_WIN_H_ | |
| OLD | NEW |