OLD | NEW |
1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/test_file_util.h" | 5 #include "base/test_file_util.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/file_path.h" | 11 #include "base/file_path.h" |
12 #include "base/file_util.h" | 12 #include "base/file_util.h" |
| 13 #include "base/logging.h" |
13 #include "base/scoped_handle.h" | 14 #include "base/scoped_handle.h" |
14 | 15 |
15 namespace file_util { | 16 namespace file_util { |
16 | 17 |
17 // We could use GetSystemInfo to get the page size, but this serves | 18 // We could use GetSystemInfo to get the page size, but this serves |
18 // our purpose fine since 4K is the page size on x86 as well as x64. | 19 // our purpose fine since 4K is the page size on x86 as well as x64. |
19 static const ptrdiff_t kPageSize = 4096; | 20 static const ptrdiff_t kPageSize = 4096; |
20 | 21 |
21 bool EvictFileFromSystemCache(const FilePath& file) { | 22 bool EvictFileFromSystemCache(const FilePath& file) { |
22 // Request exclusive access to the file and overwrite it with no buffering. | 23 // Request exclusive access to the file and overwrite it with no buffering. |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 // matter anyway. | 151 // matter anyway. |
151 EvictFileFromSystemCache(FilePath::FromWStringHack(cur_dest_path)); | 152 EvictFileFromSystemCache(FilePath::FromWStringHack(cur_dest_path)); |
152 } | 153 } |
153 } while (FindNextFile(fh, &fd)); | 154 } while (FindNextFile(fh, &fd)); |
154 | 155 |
155 FindClose(fh); | 156 FindClose(fh); |
156 return true; | 157 return true; |
157 } | 158 } |
158 | 159 |
159 } // namespace file_util | 160 } // namespace file_util |
OLD | NEW |