#include "third_party/blink/renderer/platform/instrumentation/tracing/web_process_memory_dump.h"
#include <stddef.h>
#include <string>
#include "base/memory/discardable_memory.h"
#include "base/memory/ptr_util.h"
#include "base/trace_event/process_memory_dump.h"
#include "base/trace_event/trace_event_memory_overhead.h"
#include "base/trace_event/traced_value.h"
#include "skia/ext/skia_trace_memory_dump_impl.h"
#include "third_party/blink/renderer/platform/instrumentation/tracing/web_memory_allocator_dump.h"
#include "third_party/blink/renderer/platform/wtf/text/string_utf8_adaptor.h"
namespace blink {
WebProcessMemoryDump::WebProcessMemoryDump()
: … { … }
WebProcessMemoryDump::WebProcessMemoryDump(
base::trace_event::MemoryDumpLevelOfDetail level_of_detail,
base::trace_event::ProcessMemoryDump* process_memory_dump)
: … { … }
WebProcessMemoryDump::~WebProcessMemoryDump() = default;
blink::WebMemoryAllocatorDump* WebProcessMemoryDump::CreateMemoryAllocatorDump(
const String& absolute_name) { … }
blink::WebMemoryAllocatorDump* WebProcessMemoryDump::CreateMemoryAllocatorDump(
const String& absolute_name,
blink::WebMemoryAllocatorDumpGuid guid) { … }
blink::WebMemoryAllocatorDump*
WebProcessMemoryDump::CreateWebMemoryAllocatorDump(
base::trace_event::MemoryAllocatorDump* memory_allocator_dump) { … }
blink::WebMemoryAllocatorDump* WebProcessMemoryDump::GetMemoryAllocatorDump(
const String& absolute_name) const { … }
void WebProcessMemoryDump::Clear() { … }
void WebProcessMemoryDump::TakeAllDumpsFrom(
blink::WebProcessMemoryDump* other) { … }
void WebProcessMemoryDump::AddOwnershipEdge(
blink::WebMemoryAllocatorDumpGuid source,
blink::WebMemoryAllocatorDumpGuid target,
int importance) { … }
void WebProcessMemoryDump::AddOwnershipEdge(
blink::WebMemoryAllocatorDumpGuid source,
blink::WebMemoryAllocatorDumpGuid target) { … }
void WebProcessMemoryDump::AddSuballocation(
blink::WebMemoryAllocatorDumpGuid source,
const String& target_node_name) { … }
SkTraceMemoryDump* WebProcessMemoryDump::CreateDumpAdapterForSkia(
const String& dump_name_prefix) { … }
blink::WebMemoryAllocatorDump*
WebProcessMemoryDump::CreateDiscardableMemoryAllocatorDump(
const std::string& name,
base::DiscardableMemory* discardable) { … }
void WebProcessMemoryDump::DumpHeapUsage(
const std::unordered_map<base::trace_event::AllocationContext,
base::trace_event::AllocationMetrics>&
metrics_by_context,
base::trace_event::TraceEventMemoryOverhead& overhead,
const char* allocator_name) { … }
}