Chromium Code Reviews| 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 48063f7817f7919d15f1dcba8574025fdd4e17d2..5d960a1cfa30f6df4fad731c06ae52c0fb978101 100644 |
| --- a/net/disk_cache/simple/simple_entry_impl.cc |
| +++ b/net/disk_cache/simple/simple_entry_impl.cc |
| @@ -696,19 +696,13 @@ void SimpleEntryImpl::OpenEntryInternal(bool have_index, |
| std::unique_ptr<SimpleEntryCreationResults> results( |
| new SimpleEntryCreationResults(SimpleEntryStat( |
| last_used_, last_modified_, data_size_, sparse_data_size_))); |
| - Closure task = base::Bind(&SimpleSynchronousEntry::OpenEntry, |
| - cache_type_, |
| - path_, |
| - entry_hash_, |
| - have_index, |
| - results.get()); |
| - Closure reply = base::Bind(&SimpleEntryImpl::CreationOperationComplete, |
| - this, |
| - callback, |
| - start_time, |
| - base::Passed(&results), |
| - out_entry, |
| - net::NetLog::TYPE_SIMPLE_CACHE_ENTRY_OPEN_END); |
| + Closure task = |
| + base::Bind(&SimpleSynchronousEntry::OpenEntry, cache_type_, path_, key_, |
| + entry_hash_, have_index, results.get()); |
| + Closure reply = |
| + base::Bind(&SimpleEntryImpl::CreationOperationComplete, this, callback, |
| + start_time, base::Passed(&results), out_entry, |
| + net::NetLog::TYPE_SIMPLE_CACHE_ENTRY_OPEN_END); |
| worker_pool_->PostTaskAndReply(FROM_HERE, task, reply); |
| } |
| @@ -1147,13 +1141,8 @@ void SimpleEntryImpl::CreationOperationComplete( |
| crc32s_[0] = in_results->stream_0_crc32; |
| crc32s_end_offset_[0] = in_results->entry_stat.data_size(0); |
| } |
| - if (key_.empty()) { |
|
Randy Smith (Not in Mondays)
2016/05/17 20:04:07
It's not really part of this CL, but I'd value hav
gavinp
2016/05/18 15:46:00
Done.
|
| + if (key_.empty()) |
| SetKey(synchronous_entry_->key()); |
| - } else { |
| - // This should only be triggered when creating an entry. The key check in |
| - // the open case is handled in SimpleBackendImpl. |
| - DCHECK_EQ(key_, synchronous_entry_->key()); |
| - } |
| UpdateDataFromEntryStat(in_results->entry_stat); |
| SIMPLE_CACHE_UMA(TIMES, |
| "EntryCreationTime", cache_type_, |
| @@ -1403,7 +1392,7 @@ int64_t SimpleEntryImpl::GetDiskUsage() const { |
| int64_t file_size = 0; |
| for (int i = 0; i < kSimpleEntryStreamCount; ++i) { |
| file_size += |
| - simple_util::GetFileSizeFromKeyAndDataSize(key_, data_size_[i]); |
| + simple_util::GetFileSizeFromDataSize(key_.size(), data_size_[i]); |
| } |
| file_size += sparse_data_size_; |
| return file_size; |