Index: net/disk_cache/simple/simple_entry_impl.cc |
diff --git a/net/disk_cache/simple/simple_entry_impl.cc b/net/disk_cache/simple/simple_entry_impl.cc |
index d817cdeda3d22ca3e093e643e9bb0c373a8149c0..5247bf61626b317bb3ca8e8f046297fe63f39195 100644 |
--- a/net/disk_cache/simple/simple_entry_impl.cc |
+++ b/net/disk_cache/simple/simple_entry_impl.cc |
@@ -143,7 +143,8 @@ int SimpleEntryImpl::ReadData(int index, |
index_->UseIfExists(key_); |
SynchronousOperationCallback sync_operation_callback = |
base::Bind(&SimpleEntryImpl::EntryOperationComplete, |
- callback, weak_ptr_factory_.GetWeakPtr(), synchronous_entry_); |
+ index_, callback, weak_ptr_factory_.GetWeakPtr(), |
+ synchronous_entry_); |
WorkerPool::PostTask(FROM_HERE, |
base::Bind(&SimpleSynchronousEntry::ReadData, |
base::Unretained(synchronous_entry_), |
@@ -167,7 +168,8 @@ int SimpleEntryImpl::WriteData(int index, |
index_->UseIfExists(key_); |
SynchronousOperationCallback sync_operation_callback = |
base::Bind(&SimpleEntryImpl::EntryOperationComplete, |
- callback, weak_ptr_factory_.GetWeakPtr(), synchronous_entry_); |
+ index_, callback, weak_ptr_factory_.GetWeakPtr(), |
+ synchronous_entry_); |
WorkerPool::PostTask(FROM_HERE, |
base::Bind(&SimpleSynchronousEntry::WriteData, |
base::Unretained(synchronous_entry_), |
@@ -258,10 +260,15 @@ void SimpleEntryImpl::CreationOperationComplete( |
// static |
void SimpleEntryImpl::EntryOperationComplete( |
+ base::WeakPtr<SimpleIndex> index, |
const CompletionCallback& completion_callback, |
base::WeakPtr<SimpleEntryImpl> entry, |
SimpleSynchronousEntry* sync_entry, |
int result) { |
+ DCHECK(index); |
gavinp
2013/04/09 16:28:04
I don't think this DCHECK is right. What if the ba
felipeg
2013/04/09 16:36:39
Done.
|
+ if (sync_entry && index) |
+ index->UpdateEntrySize(sync_entry->key(), sync_entry->GetFileSize()); |
+ |
if (entry) { |
DCHECK(entry->synchronous_entry_in_use_by_worker_); |
entry->synchronous_entry_in_use_by_worker_ = false; |
@@ -286,8 +293,9 @@ void SimpleEntryImpl::SetSynchronousData() { |
// filesystems not being accurate. |
last_used_ = synchronous_entry_->last_used(); |
last_modified_ = synchronous_entry_->last_modified(); |
- for (int i = 0; i < kSimpleEntryFileCount; ++i) |
+ for (int i = 0; i < kSimpleEntryFileCount; ++i) { |
data_size_[i] = synchronous_entry_->data_size(i); |
+ } |
gavinp
2013/04/09 16:28:04
Nit: lose braces.
felipeg
2013/04/09 16:36:39
Done.
|
} |
} // namespace disk_cache |