#include "third_party/blink/renderer/platform/heap/blink_gc_memory_dump_provider.h"
#include <inttypes.h>
#include <ios>
#include <sstream>
#include <string>
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
#include "base/task/single_thread_task_runner.h"
#include "base/trace_event/memory_allocator_dump.h"
#include "base/trace_event/memory_dump_manager.h"
#include "third_party/blink/renderer/platform/heap/thread_state.h"
#include "v8/include/cppgc/heap-statistics.h"
#include "v8/include/v8-isolate.h"
namespace blink {
namespace {
constexpr const char* HeapTypeString(
BlinkGCMemoryDumpProvider::HeapType heap_type) { … }
void RecordType(
std::vector<cppgc::HeapStatistics::ObjectStatsEntry>& global_object_stats,
const cppgc::HeapStatistics::ObjectStatsEntry& local_object_stats,
size_t entry_index) { … }
std::string GetUniqueName(std::string name, size_t id) { … }
}
BlinkGCMemoryDumpProvider::BlinkGCMemoryDumpProvider(
ThreadState* thread_state,
scoped_refptr<base::SingleThreadTaskRunner> task_runner,
BlinkGCMemoryDumpProvider::HeapType heap_type)
: … { … }
BlinkGCMemoryDumpProvider::~BlinkGCMemoryDumpProvider() { … }
namespace {
template <typename Stats>
size_t GetFragmentation(const Stats& stats) { … }
}
bool BlinkGCMemoryDumpProvider::OnMemoryDump(
const base::trace_event::MemoryDumpArgs& args,
base::trace_event::ProcessMemoryDump* process_memory_dump) { … }
}