Chromium Code Reviews| Index: content/child/child_discardable_shared_memory_manager.cc |
| diff --git a/content/child/child_discardable_shared_memory_manager.cc b/content/child/child_discardable_shared_memory_manager.cc |
| index 44384491f1d4e739dadbe8a3851352bb11dc7bb0..9f44b3974f289151c0fbdcd840801d7bb58fa341 100644 |
| --- a/content/child/child_discardable_shared_memory_manager.cc |
| +++ b/content/child/child_discardable_shared_memory_manager.cc |
| @@ -235,6 +235,13 @@ bool ChildDiscardableSharedMemoryManager::OnMemoryDump( |
| return heap_.OnMemoryDump(pmd); |
| } |
| +size_t ChildDiscardableSharedMemoryManager::GetMemoryUsage() const { |
|
bashi
2016/09/22 23:28:26
It may be consistent when this returns a struct li
|
| + base::AutoLock lock(lock_); |
| + const size_t total_size = heap_.GetSize(); |
| + const size_t freelist_size = heap_.GetSizeOfFreeLists(); |
| + return total_size - freelist_size; |
| +} |
| + |
| void ChildDiscardableSharedMemoryManager::ReleaseFreeMemory() { |
| base::AutoLock lock(lock_); |