Chromium Code Reviews| Index: net/disk_cache/memory/mem_backend_impl.cc |
| diff --git a/net/disk_cache/memory/mem_backend_impl.cc b/net/disk_cache/memory/mem_backend_impl.cc |
| index 3aa103b30a02edb0102eead7d15f94a0c91d504f..fd99a50e0d3e591c82b2dc06b9777b9ac6589a12 100644 |
| --- a/net/disk_cache/memory/mem_backend_impl.cc |
| +++ b/net/disk_cache/memory/mem_backend_impl.cc |
| @@ -11,6 +11,7 @@ |
| #include "base/logging.h" |
| #include "base/memory/ptr_util.h" |
| #include "base/sys_info.h" |
| +#include "base/trace_event/memory_usage_estimator.h" |
| #include "net/base/net_errors.h" |
| #include "net/disk_cache/cache_util.h" |
| #include "net/disk_cache/memory/mem_entry_impl.h" |
| @@ -284,8 +285,7 @@ void MemBackendImpl::OnExternalCacheHit(const std::string& key) { |
| } |
| size_t MemBackendImpl::EstimateMemoryUsage() const { |
| - // TODO(xunjieli): Implement this. crbug.com/669108. |
| - return 0; |
| + return base::trace_event::EstimateMemoryUsage(lru_list_); |
|
DmitrySkiba
2017/02/27 19:17:42
I think this should also include EMU(entries_).
jkarlin
2017/02/28 13:10:50
entries_ contains pointers to the same set of reso
DmitrySkiba
2017/02/28 16:44:52
Yes, but EMU(entries_) will estimate size take by
jkarlin
2017/02/28 17:20:34
Done.
|
| } |
| void MemBackendImpl::EvictIfNeeded() { |