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

Unified Diff: content/child/child_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/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 ff8fe4357881edab5e704846945280c75da294a7..dd432f8c8db2134547174b09cf048ad8270208f1 100644
--- a/content/child/child_discardable_shared_memory_manager.cc
+++ b/content/child/child_discardable_shared_memory_manager.cc
@@ -61,6 +61,12 @@ class DiscardableMemoryImpl : public base::DiscardableMemory {
return reinterpret_cast<void*>(span_->start() * base::GetPageSize());
}
+ base::trace_event::MemoryAllocatorDump* CreateMemoryAllocatorDump(
+ const char* name,
+ base::trace_event::ProcessMemoryDump* pmd) const override {
+ return manager_->CreateMemoryAllocatorDump(span_.get(), name, pmd);
+ }
+
private:
ChildDiscardableSharedMemoryManager* const manager_;
scoped_ptr<DiscardableSharedMemoryHeap::Span> span_;
@@ -261,6 +267,15 @@ void ChildDiscardableSharedMemoryManager::ReleaseSpan(
MemoryUsageChanged(heap_.GetSize(), heap_.GetSizeOfFreeLists());
}
+base::trace_event::MemoryAllocatorDump*
+ChildDiscardableSharedMemoryManager::CreateMemoryAllocatorDump(
+ DiscardableSharedMemoryHeap::Span* span,
+ const char* name,
+ base::trace_event::ProcessMemoryDump* pmd) const {
+ base::AutoLock lock(lock_);
+ return heap_.CreateMemoryAllocatorDump(span, name, pmd);
+}
+
scoped_ptr<base::DiscardableSharedMemory>
ChildDiscardableSharedMemoryManager::AllocateLockedDiscardableSharedMemory(
size_t size,
« no previous file with comments | « content/child/child_discardable_shared_memory_manager.h ('k') | content/common/discardable_shared_memory_heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698