summaryrefslogtreecommitdiffstats
path: root/net/disk_cache/cache_util_win.cc
diff options
context:
space:
mode:
authorpasko@chromium.org <pasko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-16 14:43:13 +0000
committerpasko@chromium.org <pasko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-16 14:43:13 +0000
commitca37f304399948559b6fff0b1829b79d70a2b51b (patch)
treeb14af96d9773526d15e2b20e5173b54e8b4c3ce2 /net/disk_cache/cache_util_win.cc
parentb49f9a6ced630850dcb20ee61c8f6b443bb317ff (diff)
downloadchromium_src-ca37f304399948559b6fff0b1829b79d70a2b51b.zip
chromium_src-ca37f304399948559b6fff0b1829b79d70a2b51b.tar.gz
chromium_src-ca37f304399948559b6fff0b1829b79d70a2b51b.tar.bz2
Make DeleteCache() recursive
This reuses base::FileEnumerator for the task on all platforms. BUG=249362 R=gavinp@chromium.org, rvargas@chromium.org Review URL: https://codereview.chromium.org/19206002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@211793 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache/cache_util_win.cc')
-rw-r--r--net/disk_cache/cache_util_win.cc29
1 files changed, 0 insertions, 29 deletions
diff --git a/net/disk_cache/cache_util_win.cc b/net/disk_cache/cache_util_win.cc
index 8c54b91..3337511 100644
--- a/net/disk_cache/cache_util_win.cc
+++ b/net/disk_cache/cache_util_win.cc
@@ -11,29 +11,6 @@
#include "base/message_loop.h"
#include "base/win/scoped_handle.h"
-namespace {
-
-// Deletes all the files on path that match search_name pattern.
-void DeleteFiles(const base::FilePath& path, const wchar_t* search_name) {
- base::FilePath name(path.Append(search_name));
-
- WIN32_FIND_DATA data;
- HANDLE handle = FindFirstFile(name.value().c_str(), &data);
- if (handle == INVALID_HANDLE_VALUE)
- return;
-
- do {
- if (data.dwFileAttributes == FILE_ATTRIBUTE_DIRECTORY ||
- data.dwFileAttributes == FILE_ATTRIBUTE_REPARSE_POINT)
- continue;
- DeleteFile(path.Append(data.cFileName).value().c_str());
- } while (FindNextFile(handle, &data));
-
- FindClose(handle);
-}
-
-} // namespace
-
namespace disk_cache {
bool MoveCache(const base::FilePath& from_path, const base::FilePath& to_path) {
@@ -46,12 +23,6 @@ bool MoveCache(const base::FilePath& from_path, const base::FilePath& to_path) {
return true;
}
-void DeleteCache(const base::FilePath& path, bool remove_folder) {
- DeleteFiles(path, L"*");
- if (remove_folder)
- RemoveDirectory(path.value().c_str());
-}
-
bool DeleteCacheFile(const base::FilePath& name) {
// We do a simple delete, without ever falling back to SHFileOperation, as the
// version from base does.