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

Unified Diff: net/disk_cache/simple/simple_index_file.cc

Issue 706203003: Update from https://crrev.com/303153 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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/simple/simple_index_file.h ('k') | net/disk_cache/simple/simple_index_file_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/simple/simple_index_file.cc
diff --git a/net/disk_cache/simple/simple_index_file.cc b/net/disk_cache/simple/simple_index_file.cc
index ac71330386e819222309a6e108d89ae273705671..95b2baee52f3fab518a1fbda1d808bd5b886a93e 100644
--- a/net/disk_cache/simple/simple_index_file.cc
+++ b/net/disk_cache/simple/simple_index_file.cc
@@ -278,18 +278,18 @@ void SimpleIndexFile::LoadIndexEntries(base::Time cache_last_modified,
void SimpleIndexFile::WriteToDisk(const SimpleIndex::EntrySet& entry_set,
uint64 cache_size,
const base::TimeTicks& start,
- bool app_on_background) {
+ bool app_on_background,
+ const base::Closure& callback) {
IndexMetadata index_metadata(entry_set.size(), cache_size);
scoped_ptr<Pickle> pickle = Serialize(index_metadata, entry_set);
- cache_thread_->PostTask(FROM_HERE,
- base::Bind(&SimpleIndexFile::SyncWriteToDisk,
- cache_type_,
- cache_directory_,
- index_file_,
- temp_index_file_,
- base::Passed(&pickle),
- base::TimeTicks::Now(),
- app_on_background));
+ base::Closure task =
+ base::Bind(&SimpleIndexFile::SyncWriteToDisk,
+ cache_type_, cache_directory_, index_file_, temp_index_file_,
+ base::Passed(&pickle), start, app_on_background);
+ if (callback.is_null())
+ cache_thread_->PostTask(FROM_HERE, task);
+ else
+ cache_thread_->PostTaskAndReply(FROM_HERE, task, callback);
}
// static
« no previous file with comments | « net/disk_cache/simple/simple_index_file.h ('k') | net/disk_cache/simple/simple_index_file_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698