diff options
author | tony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-12 17:14:59 +0000 |
---|---|---|
committer | tony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-12 17:14:59 +0000 |
commit | cfaa1f2938c346d4801b895e7181f5de7d3755e6 (patch) | |
tree | 934967a90f94c5d50939929dd6ab38ad5dceed3e /net/disk_cache/cache_util_posix.cc | |
parent | 1ee19742db740fb60ed78266039f65c93c85c836 (diff) | |
download | chromium_src-cfaa1f2938c346d4801b895e7181f5de7d3755e6.zip chromium_src-cfaa1f2938c346d4801b895e7181f5de7d3755e6.tar.gz chromium_src-cfaa1f2938c346d4801b895e7181f5de7d3755e6.tar.bz2 |
Start migrating the disk cache to using FilePath.
This converts BackendImpl to using FilePath.
BUG=24444
Review URL: http://codereview.chromium.org/261045
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28711 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache/cache_util_posix.cc')
-rw-r--r-- | net/disk_cache/cache_util_posix.cc | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/net/disk_cache/cache_util_posix.cc b/net/disk_cache/cache_util_posix.cc index cd8fdea..180e521 100644 --- a/net/disk_cache/cache_util_posix.cc +++ b/net/disk_cache/cache_util_posix.cc @@ -10,13 +10,13 @@ namespace disk_cache { -bool MoveCache(const std::wstring& from_path, const std::wstring& to_path) { +bool MoveCache(const FilePath& from_path, const FilePath& to_path) { // Just use the version from base. - return file_util::Move(from_path.c_str(), to_path.c_str()); + return file_util::Move(from_path, to_path); } -void DeleteCache(const std::wstring& path, bool remove_folder) { - file_util::FileEnumerator iter(FilePath::FromWStringHack(path), +void DeleteCache(const FilePath& path, bool remove_folder) { + file_util::FileEnumerator iter(path, /* recursive */ false, file_util::FileEnumerator::FILES); for (FilePath file = iter.Next(); !file.value().empty(); file = iter.Next()) { @@ -30,8 +30,16 @@ void DeleteCache(const std::wstring& path, bool remove_folder) { } } -bool DeleteCacheFile(const std::wstring& name) { +bool DeleteCacheFile(const FilePath& name) { return file_util::Delete(name, false); } +void DeleteCache(const std::wstring& path, bool remove_folder) { + DeleteCache(FilePath::FromWStringHack(path), remove_folder); +} + +bool DeleteCacheFile(const std::wstring& name) { + return DeleteCacheFile(FilePath::FromWStringHack(name)); +} + } // namespace disk_cache |