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

Unified Diff: content/common/host_discardable_shared_memory_manager.cc

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: Fix html_viewer. 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: content/common/host_discardable_shared_memory_manager.cc
diff --git a/content/common/host_discardable_shared_memory_manager.cc b/content/common/host_discardable_shared_memory_manager.cc
index 7590c1f9bb4c6848f950a21da491494ab04ea0d8..f436037471223dc30b2253d5361a5f2f6d4b8e24 100644
--- a/content/common/host_discardable_shared_memory_manager.cc
+++ b/content/common/host_discardable_shared_memory_manager.cc
@@ -64,6 +64,19 @@ class DiscardableMemoryImpl : public base::DiscardableMemory {
return shared_memory_->memory();
}
+ base::trace_event::MemoryAllocatorDump* CreateMemoryAllocatorDump(
+ const char* name,
+ base::trace_event::ProcessMemoryDump* pmd) const override {
+ // The memory could have been purged, but we still create a dump with
+ // mapped_size. So, the size can be inaccurate.
+ base::trace_event::MemoryAllocatorDump* dump =
+ pmd->CreateAllocatorDump(name);
+ dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize,
+ base::trace_event::MemoryAllocatorDump::kUnitsBytes,
+ shared_memory_->mapped_size());
+ return dump;
+ }
+
private:
scoped_ptr<base::DiscardableSharedMemory> shared_memory_;
const base::Closure deleted_callback_;
« no previous file with comments | « content/common/discardable_shared_memory_heap_unittest.cc ('k') | gpu/skia_runner/in_process_graphics_system.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698