1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "content/child/web_process_memory_dump_impl.h"
7 #include "base/trace_event/process_memory_dump.h"
8 #include "content/child/web_memory_allocator_dump_impl.h"
12 WebProcessMemoryDumpImpl::WebProcessMemoryDumpImpl(
13 base::trace_event::ProcessMemoryDump
* process_memory_dump
)
14 : process_memory_dump_(process_memory_dump
) {
17 WebProcessMemoryDumpImpl::~WebProcessMemoryDumpImpl() {
20 blink::WebMemoryAllocatorDump
*
21 WebProcessMemoryDumpImpl::createMemoryAllocatorDump(
22 const blink::WebString
& absolute_name
) {
23 // Get a MemoryAllocatorDump from the base/ object.
24 base::trace_event::MemoryAllocatorDump
* mad
=
25 process_memory_dump_
->CreateAllocatorDump(absolute_name
.utf8());
29 // Wrap it and return to blink.
30 WebMemoryAllocatorDumpImpl
* web_mad_impl
=
31 new WebMemoryAllocatorDumpImpl(mad
);
33 // memory_allocator_dumps_ will take ownership of |web_mad_impl|.
34 memory_allocator_dumps_
.push_back(web_mad_impl
);
38 } // namespace content