| Index: net/disk_cache/cache_util_win.cc
|
| diff --git a/net/disk_cache/cache_util_win.cc b/net/disk_cache/cache_util_win.cc
|
| index 3a99836ed7250fa932b2a17b566fb3fb68c0263c..46bffe8f99b7cc60d0a04231604f14675ef1d669 100644
|
| --- a/net/disk_cache/cache_util_win.cc
|
| +++ b/net/disk_cache/cache_util_win.cc
|
| @@ -39,26 +39,34 @@ void DeleteFiles(const wchar_t* path, const wchar_t* search_name) {
|
|
|
| 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) {
|
| // I don't want to use the shell version of move because if something goes
|
| // wrong, that version will attempt to move file by file and fail at the end.
|
| - if (!MoveFileEx(from_path.c_str(), to_path.c_str(), 0)) {
|
| + if (!MoveFileEx(from_path.value().c_str(), to_path.value().c_str(), 0)) {
|
| LOG(ERROR) << "Unable to move the cache: " << GetLastError();
|
| return false;
|
| }
|
| return true;
|
| }
|
|
|
| -void DeleteCache(const std::wstring& path, bool remove_folder) {
|
| - DeleteFiles(path.c_str(), L"*");
|
| +void DeleteCache(const FilePath& path, bool remove_folder) {
|
| + DeleteFiles(path.value().c_str(), L"*");
|
| if (remove_folder)
|
| - RemoveDirectory(path.c_str());
|
| + RemoveDirectory(path.value().c_str());
|
| }
|
|
|
| -bool DeleteCacheFile(const std::wstring& name) {
|
| +bool DeleteCacheFile(const FilePath& name) {
|
| // We do a simple delete, without ever falling back to SHFileOperation, as the
|
| // version from base does.
|
| - return DeleteFile(name.c_str()) ? true : false;
|
| + return DeleteFile(name.value().c_str()) ? true : 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
|
|
|