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

Unified Diff: net/disk_cache/backend_impl.cc

Issue 2854053: Disk cache: Stop evictions while performing final cleanup.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years, 5 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
Index: net/disk_cache/backend_impl.cc
===================================================================
--- net/disk_cache/backend_impl.cc (revision 52792)
+++ net/disk_cache/backend_impl.cc (working copy)
@@ -259,7 +259,7 @@
};
void FinalCleanup::Run() {
- backend_->CleanupCache();
+ backend_->StartCleanup();
}
} // namespace
@@ -525,6 +525,15 @@
return disabled_ ? net::ERR_FAILED : net::OK;
}
+void BackendImpl::StartCleanup() {
+ Trace("Backend StartCleanup");
+ eviction_.Stop();
+
+ // Give a chance for any posted evictions to be discarded.
+ MessageLoop::current()->PostTask(FROM_HERE,
+ factory_.NewRunnableMethod(&BackendImpl::CleanupCache));
+}
+
void BackendImpl::CleanupCache() {
Trace("Backend Cleanup");
if (init_) {

Powered by Google App Engine
This is Rietveld 408576698