| Index: components/html_viewer/discardable_memory_allocator.cc
|
| diff --git a/components/html_viewer/discardable_memory_allocator.cc b/components/html_viewer/discardable_memory_allocator.cc
|
| index 7f362239b2d5f0c4bebd6be4c01913b4f0ee06a4..87f58e94d67864aea6fea09ef42604b21c1fd00f 100644
|
| --- a/components/html_viewer/discardable_memory_allocator.cc
|
| +++ b/components/html_viewer/discardable_memory_allocator.cc
|
| @@ -6,6 +6,9 @@
|
|
|
| #include "base/memory/discardable_memory.h"
|
| #include "base/stl_util.h"
|
| +#include "base/trace_event/memory_allocator_dump.h"
|
| +#include "base/trace_event/memory_dump_manager.h"
|
| +#include "base/trace_event/process_memory_dump.h"
|
|
|
| namespace html_viewer {
|
|
|
| @@ -53,6 +56,21 @@ class DiscardableMemoryAllocator::DiscardableMemoryChunkImpl
|
| return nullptr;
|
| }
|
|
|
| + base::trace_event::MemoryAllocatorDump* CreateMemoryAllocatorDump(
|
| + const char* name,
|
| + base::trace_event::ProcessMemoryDump* pmd) const override {
|
| + base::trace_event::MemoryAllocatorDump* dump =
|
| + pmd->CreateAllocatorDump(name);
|
| + dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize,
|
| + base::trace_event::MemoryAllocatorDump::kUnitsBytes, size_);
|
| +
|
| + // Memory is allocated from system allocator (malloc).
|
| + pmd->AddSuballocation(dump->guid(),
|
| + base::trace_event::MemoryDumpManager::GetInstance()
|
| + ->system_allocator_pool_name());
|
| + return dump;
|
| + }
|
| +
|
| size_t size() const { return size_; }
|
|
|
| void Discard() {
|
|
|