[email protected] | 5138d5f | 2011-05-07 00:49:34 | [diff] [blame^] | 1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
license.bot | bf09a50 | 2008-08-24 00:55:55 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. | ||||
[email protected] | 408d35f5 | 2008-08-13 18:30:22 | [diff] [blame] | 4 | |
5 | #ifndef NET_DISK_CACHE_CACHE_UTIL_H_ | ||||
6 | #define NET_DISK_CACHE_CACHE_UTIL_H_ | ||||
[email protected] | 32b76ef | 2010-07-26 23:08:24 | [diff] [blame] | 7 | #pragma once |
[email protected] | 408d35f5 | 2008-08-13 18:30:22 | [diff] [blame] | 8 | |
[email protected] | 408d35f5 | 2008-08-13 18:30:22 | [diff] [blame] | 9 | #include "base/basictypes.h" |
[email protected] | 5138d5f | 2011-05-07 00:49:34 | [diff] [blame^] | 10 | #include "net/base/net_api.h" |
[email protected] | 408d35f5 | 2008-08-13 18:30:22 | [diff] [blame] | 11 | |
[email protected] | cfaa1f2 | 2009-10-12 17:14:59 | [diff] [blame] | 12 | class FilePath; |
13 | |||||
[email protected] | 408d35f5 | 2008-08-13 18:30:22 | [diff] [blame] | 14 | namespace disk_cache { |
15 | |||||
[email protected] | 408d35f5 | 2008-08-13 18:30:22 | [diff] [blame] | 16 | // Moves the cache files from the given path to another location. |
[email protected] | 831a1a76 | 2010-10-12 05:57:08 | [diff] [blame] | 17 | // Fails if the destination exists already, or if it doesn't have |
18 | // permission for the operation. This is basically a rename operation | ||||
19 | // for the cache directory. Returns true if successful. On ChromeOS, | ||||
20 | // this moves the cache contents, and leaves the empty cache | ||||
21 | // directory. | ||||
[email protected] | 5138d5f | 2011-05-07 00:49:34 | [diff] [blame^] | 22 | NET_TEST bool MoveCache(const FilePath& from_path, const FilePath& to_path); |
[email protected] | 408d35f5 | 2008-08-13 18:30:22 | [diff] [blame] | 23 | |
24 | // Deletes the cache files stored on |path|, and optionally also attempts to | ||||
25 | // delete the folder itself. | ||||
[email protected] | 5138d5f | 2011-05-07 00:49:34 | [diff] [blame^] | 26 | NET_TEST void DeleteCache(const FilePath& path, bool remove_folder); |
[email protected] | 408d35f5 | 2008-08-13 18:30:22 | [diff] [blame] | 27 | |
[email protected] | a88d601f | 2008-08-15 20:36:21 | [diff] [blame] | 28 | // Deletes a cache file. |
[email protected] | 5138d5f | 2011-05-07 00:49:34 | [diff] [blame^] | 29 | NET_TEST bool DeleteCacheFile(const FilePath& name); |
[email protected] | a88d601f | 2008-08-15 20:36:21 | [diff] [blame] | 30 | |
[email protected] | 408d35f5 | 2008-08-13 18:30:22 | [diff] [blame] | 31 | } // namespace disk_cache |
32 | |||||
33 | #endif // NET_DISK_CACHE_CACHE_UTIL_H_ |