Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(230)

Unified Diff: net/disk_cache/cache_util_posix.cc

Issue 261045: Start migrating the disk cache to using FilePath. (Closed)
Patch Set: rebase Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/disk_cache/cache_util.h ('k') | net/disk_cache/cache_util_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/cache_util_posix.cc
diff --git a/net/disk_cache/cache_util_posix.cc b/net/disk_cache/cache_util_posix.cc
index cd8fdeac50cb64cf2195e63881849845d9d209c6..180e521200d79ee596949dcc8cf6f9788158d1f7 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
« no previous file with comments | « net/disk_cache/cache_util.h ('k') | net/disk_cache/cache_util_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698