OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 "net/disk_cache/cache_util.h" | 5 #include "net/disk_cache/cache_util.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 | 8 |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
12 #include "base/win/scoped_handle.h" | 12 #include "base/win/scoped_handle.h" |
13 | 13 |
14 namespace { | 14 namespace { |
15 | 15 |
16 // Deletes all the files on path that match search_name pattern. | 16 // Deletes all the files on path that match search_name pattern. |
17 void DeleteFiles(const base::FilePath& path, const wchar_t* search_name) { | 17 void DeleteFiles(const base::FilePath& path, const wchar_t* search_name) { |
18 base::FilePath name(path.Append(search_name)); | 18 base::FilePath name(path.Append(search_name)); |
19 | 19 |
20 WIN32_FIND_DATA data; | 20 WIN32_FIND_DATA data; |
21 HANDLE handle = FindFirstFile(name.value().c_str(), &data); | 21 HANDLE handle = FindFirstFile(name.value().c_str(), &data); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 name.value().c_str(), access, sharing, NULL, OPEN_EXISTING, 0, NULL)); | 66 name.value().c_str(), access, sharing, NULL, OPEN_EXISTING, 0, NULL)); |
67 if (file.IsValid()) | 67 if (file.IsValid()) |
68 return false; | 68 return false; |
69 | 69 |
70 // Most likely there is no file to open... and that's what we wanted. | 70 // Most likely there is no file to open... and that's what we wanted. |
71 } | 71 } |
72 return true; | 72 return true; |
73 } | 73 } |
74 | 74 |
75 } // namespace disk_cache | 75 } // namespace disk_cache |
OLD | NEW |