Index: chrome/app/file_pre_reader_win.h |
diff --git a/chrome/app/file_pre_reader_win.h b/chrome/app/file_pre_reader_win.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..f8ad7a9423b03c736dc861177e78cea5f200aa20 |
--- /dev/null |
+++ b/chrome/app/file_pre_reader_win.h |
@@ -0,0 +1,23 @@ |
+// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+// This file defines a function to pre-read a file in order to avoid touching |
+// the disk when it is subsequently used. |
+ |
+#ifndef CHROME_APP_FILE_PRE_READER_WIN_H_ |
+#define CHROME_APP_FILE_PRE_READER_WIN_H_ |
+ |
+#include <stddef.h> |
+ |
+#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.
|
+ |
+// 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.
|
+// used. The function checks the Windows version to determine which pre-reading |
+// mechanism to use. On Vista+, chunks of |step_size| bytes are read into a |
+// buffer. The bigger |step_size| is, the faster the file is pre-read (up to |
+// 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
|
+// for the buffer. |
+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.
|
+ |
+#endif // CHROME_APP_FILE_PRE_READER_WIN_H_ |