blob: 47630b9c9a92ca97d5861500411b8ca9c40d628d [file] [log] [blame]
[email protected]5138d5f2011-05-07 00:49:341// Copyright (c) 2011 The Chromium Authors. All rights reserved.
license.botbf09a502008-08-24 00:55:552// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
[email protected]408d35f52008-08-13 18:30:224
5#ifndef NET_DISK_CACHE_CACHE_UTIL_H_
6#define NET_DISK_CACHE_CACHE_UTIL_H_
[email protected]32b76ef2010-07-26 23:08:247#pragma once
[email protected]408d35f52008-08-13 18:30:228
[email protected]408d35f52008-08-13 18:30:229#include "base/basictypes.h"
[email protected]5138d5f2011-05-07 00:49:3410#include "net/base/net_api.h"
[email protected]408d35f52008-08-13 18:30:2211
[email protected]cfaa1f22009-10-12 17:14:5912class FilePath;
13
[email protected]408d35f52008-08-13 18:30:2214namespace disk_cache {
15
[email protected]408d35f52008-08-13 18:30:2216// Moves the cache files from the given path to another location.
[email protected]831a1a762010-10-12 05:57:0817// 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]5138d5f2011-05-07 00:49:3422NET_TEST bool MoveCache(const FilePath& from_path, const FilePath& to_path);
[email protected]408d35f52008-08-13 18:30:2223
24// Deletes the cache files stored on |path|, and optionally also attempts to
25// delete the folder itself.
[email protected]5138d5f2011-05-07 00:49:3426NET_TEST void DeleteCache(const FilePath& path, bool remove_folder);
[email protected]408d35f52008-08-13 18:30:2227
[email protected]a88d601f2008-08-15 20:36:2128// Deletes a cache file.
[email protected]5138d5f2011-05-07 00:49:3429NET_TEST bool DeleteCacheFile(const FilePath& name);
[email protected]a88d601f2008-08-15 20:36:2130
[email protected]408d35f52008-08-13 18:30:2231} // namespace disk_cache
32
33#endif // NET_DISK_CACHE_CACHE_UTIL_H_