Index: base/memory/discardable_memory.h |
diff --git a/base/memory/discardable_memory.h b/base/memory/discardable_memory.h |
index fc189e746341136d0190e0329d3c375be8500af2..e5ba7cc5602011ffce68ba43dc9ce18ab3891c3b 100644 |
--- a/base/memory/discardable_memory.h |
+++ b/base/memory/discardable_memory.h |
@@ -10,6 +10,10 @@ |
#include "base/compiler_specific.h" |
namespace base { |
+namespace trace_event { |
+class MemoryAllocatorDump; |
+class ProcessMemoryDump; |
+} |
// Discardable memory is used to cache large objects without worrying about |
// blowing out memory, both on mobile devices where there is no swap, and |
@@ -59,6 +63,14 @@ class BASE_EXPORT DiscardableMemory { |
template<typename T> T* data_as() const { |
return reinterpret_cast<T*>(data()); |
} |
+ |
+ // Used for dumping the statistics of discardable memory allocated in tracing. |
+ // Returns nullptr if the memory is purged by the allocator. Returns a new |
reveman
2015/08/21 18:05:24
"Returns nullptr if the memory is purged by the al
ssid
2015/08/21 19:02:30
Yes that makes sense, I will make it dump size 0.
ssid
2015/08/24 14:52:09
Done.
|
+ // MemoryAllocatorDump in the |pmd| with the size of the discardable memory. |
+ // See ProcessMemoryDump::CreateAllocatorDump. |
+ virtual trace_event::MemoryAllocatorDump* CreateMemoryAllocatorDump( |
+ const char* name, |
+ trace_event::ProcessMemoryDump* pmd) = 0; |
}; |
} // namespace base |