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

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
« no previous file with comments | « no previous file | base/test/test_discardable_memory_allocator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/memory/discardable_memory.h
diff --git a/base/memory/discardable_memory.h b/base/memory/discardable_memory.h
index fc189e746341136d0190e0329d3c375be8500af2..af27b7b6d0f6f5ec2b84f6e1eb1c0e9823cf1dba 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 {
Avi (use Gerrit) 2015/08/24 17:43:43 newline before this one
ssid 2015/08/24 17:53:55 But, most files do not seem to have the new line h
+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,13 @@ 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 a new MemoryAllocatorDump in the |pmd| with the size of the
Avi (use Gerrit) 2015/08/24 17:43:43 "returns a new dump" implies ownership transfer, w
ssid 2015/08/24 17:53:54 Done.
+ // 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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698