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

Unified Diff: net/disk_cache/backend_impl.cc

Issue 9088002: Revert "Revert the disk_cache change part of http://codereview.chromium.org/9035012" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 12 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 | « no previous file | tools/valgrind/gtest_exclude/net_unittests.gtest-tsan_win32.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/backend_impl.cc
diff --git a/net/disk_cache/backend_impl.cc b/net/disk_cache/backend_impl.cc
index c86d9a886cfee9c71a92260ba8545b02d9499d61..a014c5adf3eb8ea8720fcd401ebb7615dc091c05 100644
--- a/net/disk_cache/backend_impl.cc
+++ b/net/disk_cache/backend_impl.cc
@@ -87,23 +87,10 @@ FilePath GetPrefixedName(const FilePath& path, const std::string& name,
return path.AppendASCII(tmp);
}
-// This is a simple Task to cleanup old caches.
-class CleanupTask : public Task {
- public:
- CleanupTask(const FilePath& path, const std::string& name)
- : path_(path), name_(name) {}
-
- virtual void Run();
-
- private:
- FilePath path_;
- std::string name_;
- DISALLOW_COPY_AND_ASSIGN(CleanupTask);
-};
-
-void CleanupTask::Run() {
+// This is a simple callback to cleanup old caches.
+void CleanupCallback(const FilePath& path, const std::string& name) {
for (int i = 0; i < kMaxOldFolders; i++) {
- FilePath to_delete = GetPrefixedName(path_, name_, i);
+ FilePath to_delete = GetPrefixedName(path, name, i);
disk_cache::DeleteCache(to_delete, true);
}
}
@@ -148,7 +135,8 @@ bool DelayedCacheCleanup(const FilePath& full_path) {
return false;
}
- base::WorkerPool::PostTask(FROM_HERE, new CleanupTask(path, name_str), true);
+ base::WorkerPool::PostTask(
+ FROM_HERE, base::Bind(&CleanupCallback, path, name_str), true);
return true;
}
« no previous file with comments | « no previous file | tools/valgrind/gtest_exclude/net_unittests.gtest-tsan_win32.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698