diff options
author | pasko@chromium.org <pasko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-17 15:50:45 +0000 |
---|---|---|
committer | pasko@chromium.org <pasko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-17 15:50:45 +0000 |
commit | 76ed979ee14c9919763621c2079a3d020d442f6d (patch) | |
tree | 79b72e2f6214630124c3242ad64620dd1aa8cffa /net/disk_cache/cache_util_win.cc | |
parent | 3d41478deea02db2f66b88f5c429a2af7b5871a4 (diff) | |
download | chromium_src-76ed979ee14c9919763621c2079a3d020d442f6d.zip chromium_src-76ed979ee14c9919763621c2079a3d020d442f6d.tar.gz chromium_src-76ed979ee14c9919763621c2079a3d020d442f6d.tar.bz2 |
Re-land "Make DeleteCache() recursive"
This adds a suppression on seemingly false tsan report for SHFileOperationW.
Original message:
This reuses base::FileEnumerator for the task on all platforms.
BUG=249362
TBR=gavinp@chromium.org
Review URL: https://codereview.chromium.org/19599002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@212053 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache/cache_util_win.cc')
-rw-r--r-- | net/disk_cache/cache_util_win.cc | 29 |
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. |