Chromium Code Reviews| Index: net/disk_cache/simple/simple_backend_impl.cc |
| diff --git a/net/disk_cache/simple/simple_backend_impl.cc b/net/disk_cache/simple/simple_backend_impl.cc |
| index f985e58ae89f292cf7c46a6adce8cc296c7d5f88..382cf4c158582595a391f6c156aeb2662acc3e88 100644 |
| --- a/net/disk_cache/simple/simple_backend_impl.cc |
| +++ b/net/disk_cache/simple/simple_backend_impl.cc |
| @@ -470,10 +470,20 @@ int SimpleBackendImpl::DoomEntriesSince( |
| return DoomEntriesBetween(initial_time, Time(), callback); |
| } |
| +void SimpleBackendImpl::IndexReadyForCalculation( |
| + const CompletionCallback& callback, |
| + int result) { |
| + if (result == net::OK) |
| + result = static_cast<int>(index_->GetCacheSize()); |
|
msramek
2015/10/09 09:32:24
cache_size_, and thus also GetCacheSize(), are uin
pasko
2015/10/09 15:52:03
We do not want to introduce more constraints in th
msramek
2015/10/13 09:45:06
Ah ok, good to know. Still, I'd like to keep the s
|
| + callback.Run(result); |
| +} |
| + |
| int SimpleBackendImpl::CalculateSizeOfAllEntries( |
| const CompletionCallback& callback) { |
| - // TODO(msramek): Implement. |
| - return net::ERR_NOT_IMPLEMENTED; |
| + return index_->ExecuteWhenReady( |
| + base::Bind(&SimpleBackendImpl::IndexReadyForCalculation, |
| + AsWeakPtr(), |
| + callback)); |
| } |
| class SimpleBackendImpl::SimpleIterator final : public Iterator { |