#include "gin/v8_isolate_memory_dump_provider.h"
#include <inttypes.h>
#include <stddef.h>
#include "base/check_op.h"
#include "base/notreached.h"
#include "base/strings/stringprintf.h"
#include "base/task/single_thread_task_runner.h"
#include "base/trace_event/memory_dump_manager.h"
#include "base/trace_event/process_memory_dump.h"
#include "gin/public/isolate_holder.h"
#include "v8/include/v8-isolate.h"
#include "v8/include/v8-locker.h"
#include "v8/include/v8-statistics.h"
namespace gin {
V8IsolateMemoryDumpProvider::V8IsolateMemoryDumpProvider(
IsolateHolder* isolate_holder,
scoped_refptr<base::SingleThreadTaskRunner> task_runner)
: … { … }
V8IsolateMemoryDumpProvider::~V8IsolateMemoryDumpProvider() { … }
bool V8IsolateMemoryDumpProvider::OnMemoryDump(
const base::trace_event::MemoryDumpArgs& args,
base::trace_event::ProcessMemoryDump* process_memory_dump) { … }
namespace {
void DumpCodeStatistics(base::trace_event::MemoryAllocatorDump* dump,
IsolateHolder* isolate_holder) { … }
void DumpContextStatistics(
base::trace_event::ProcessMemoryDump* process_memory_dump,
std::string dump_base_name,
std::string dump_name_suffix,
size_t number_of_detached_contexts,
size_t number_of_native_contexts) { … }
std::string IsolateTypeString(IsolateHolder::IsolateType isolate_type) { … }
bool CanHaveMultipleIsolates(IsolateHolder::IsolateType isolate_type) { … }
}
void V8IsolateMemoryDumpProvider::DumpHeapStatistics(
const base::trace_event::MemoryDumpArgs& args,
base::trace_event::ProcessMemoryDump* process_memory_dump) { … }
}