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( |
|
gavinp
2015/10/13 15:50:12
Isn't this an ordering violation? See https://goog
msramek
2015/10/13 17:25:50
Yep. I tried to follow IndexReadyForDoom, but that
|
| + const CompletionCallback& callback, |
| + int result) { |
| + if (result == net::OK) |
| + result = static_cast<int>(index_->GetCacheSize()); |
| + 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)); |
|
gavinp
2015/10/13 15:50:12
Did git cl format not join these lines? Weird...
msramek
2015/10/13 17:25:50
Ehm, I didn't run it.
gavinp
2015/10/14 15:08:06
We're very diligent about that in net/. Generally
msramek
2015/10/14 16:11:58
Acknowledged.
|
| } |
| class SimpleBackendImpl::SimpleIterator final : public Iterator { |