OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef NET_DISK_CACHE_CACHE_UTIL_H_ | 5 #ifndef NET_DISK_CACHE_CACHE_UTIL_H_ |
6 #define NET_DISK_CACHE_CACHE_UTIL_H_ | 6 #define NET_DISK_CACHE_CACHE_UTIL_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "net/base/net_export.h" | 9 #include "net/base/net_export.h" |
10 | 10 |
| 11 namespace base { |
11 class FilePath; | 12 class FilePath; |
| 13 } |
12 | 14 |
13 namespace disk_cache { | 15 namespace disk_cache { |
14 | 16 |
15 // Moves the cache files from the given path to another location. | 17 // Moves the cache files from the given path to another location. |
16 // Fails if the destination exists already, or if it doesn't have | 18 // Fails if the destination exists already, or if it doesn't have |
17 // permission for the operation. This is basically a rename operation | 19 // permission for the operation. This is basically a rename operation |
18 // for the cache directory. Returns true if successful. On ChromeOS, | 20 // for the cache directory. Returns true if successful. On ChromeOS, |
19 // this moves the cache contents, and leaves the empty cache | 21 // this moves the cache contents, and leaves the empty cache |
20 // directory. | 22 // directory. |
21 NET_EXPORT_PRIVATE bool MoveCache(const FilePath& from_path, | 23 NET_EXPORT_PRIVATE bool MoveCache(const base::FilePath& from_path, |
22 const FilePath& to_path); | 24 const base::FilePath& to_path); |
23 | 25 |
24 // Deletes the cache files stored on |path|, and optionally also attempts to | 26 // Deletes the cache files stored on |path|, and optionally also attempts to |
25 // delete the folder itself. | 27 // delete the folder itself. |
26 NET_EXPORT_PRIVATE void DeleteCache(const FilePath& path, bool remove_folder); | 28 NET_EXPORT_PRIVATE void DeleteCache(const base::FilePath& path, |
| 29 bool remove_folder); |
27 | 30 |
28 // Deletes a cache file. | 31 // Deletes a cache file. |
29 NET_EXPORT_PRIVATE bool DeleteCacheFile(const FilePath& name); | 32 NET_EXPORT_PRIVATE bool DeleteCacheFile(const base::FilePath& name); |
30 | 33 |
31 } // namespace disk_cache | 34 } // namespace disk_cache |
32 | 35 |
33 #endif // NET_DISK_CACHE_CACHE_UTIL_H_ | 36 #endif // NET_DISK_CACHE_CACHE_UTIL_H_ |
OLD | NEW |