Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(675)

Unified Diff: base/memory/discardable_memory.h

Issue 1306243003: Add support to create memory allocator dump in base::DiscardableMemory (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nits. Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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
« no previous file with comments | « no previous file | base/test/test_discardable_memory_allocator.cc » ('j') | content/common/discardable_shared_memory_heap.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698