#include "components/services/heap_profiling/connection_manager.h"
#include <utility>
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/json/string_escape.h"
#include "base/metrics/histogram_macros.h"
#include "components/services/heap_profiling/json_exporter.h"
#include "components/services/heap_profiling/public/cpp/profiling_client.h"
namespace heap_profiling {
struct ConnectionManager::DumpProcessesForTracingTracking
: public base::RefCountedThreadSafe<DumpProcessesForTracingTracking> { … };
struct ConnectionManager::Connection { … };
ConnectionManager::ConnectionManager() { … }
ConnectionManager::~ConnectionManager() = default;
void ConnectionManager::OnNewConnection(
base::ProcessId pid,
mojo::PendingRemote<mojom::ProfilingClient> client,
mojom::ProcessType process_type,
mojom::ProfilingParamsPtr params,
mojom::ProfilingService::AddProfilingClientCallback
started_profiling_closure) { … }
std::vector<base::ProcessId> ConnectionManager::GetConnectionPids() { … }
std::vector<base::ProcessId>
ConnectionManager::GetConnectionPidsThatNeedVmRegions() { … }
void ConnectionManager::OnConnectionComplete(base::ProcessId pid) { … }
void ConnectionManager::OnProfilingStarted(base::ProcessId pid) { … }
void ConnectionManager::ReportMetrics() { … }
void ConnectionManager::DumpProcessesForTracing(
bool strip_path_from_mapped_files,
bool write_proto,
DumpProcessesForTracingCallback callback,
VmRegions vm_regions) { … }
bool ConnectionManager::ConvertProfileToExportParams(
mojom::HeapProfilePtr profile,
uint32_t sampling_rate,
ExportParams* params) { … }
void ConnectionManager::HeapProfileRetrieved(
scoped_refptr<DumpProcessesForTracingTracking> tracking,
base::ProcessId pid,
mojom::ProcessType process_type,
bool strip_path_from_mapped_files,
uint32_t sampling_rate,
mojom::HeapProfilePtr profile) { … }
}