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