Chromium Code Reviews| 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..a59ea768339f0118b8304683ad82f4cefb5de69d |
| --- /dev/null |
| +++ b/chrome/app/file_pre_reader_win.h |
| @@ -0,0 +1,24 @@ |
| +// 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 hard page |
| +// faults when it is subsequently used. |
| + |
| +#ifndef CHROME_APP_FILE_PRE_READER_WIN_H_ |
| +#define CHROME_APP_FILE_PRE_READER_WIN_H_ |
| + |
| +#include "base/basictypes.h" |
|
grt (UTC plus 2)
2015/10/29 19:15:07
unused
fdoray
2015/10/30 21:08:54
Done.
|
| + |
| +class FilePreReader { |
|
grt (UTC plus 2)
2015/10/29 19:15:07
make this a free function rather than a class stat
fdoray
2015/10/30 21:08:54
Done.
|
| + public: |
| + // Reads the file passed in and touches pages to avoid hard page faults when |
| + // the file is used. The step size indicates the number of bytes to skip after |
| + // each touched byte. |
|
grt (UTC plus 2)
2015/10/29 19:15:07
how should the caller pick a value for |step_size|
fdoray
2015/10/30 21:08:54
Done. Eventually, we should remove the parameter a
|
| + // |
| + // This function checks the Windows version to determine which pre-reading |
| + // mechanism to use. |
| + static bool PreReadImage(const wchar_t* file_path, size_t step_size); |
|
grt (UTC plus 2)
2015/10/29 19:15:07
why "Image" in the name when this is file_pre_read
fdoray
2015/10/30 21:08:54
Done.
|
| +}; |
| + |
| +#endif // CHROME_APP_FILE_PRE_READER_WIN_H_ |