// Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
module heap_profiling.mojom;
import "components/services/heap_profiling/public/mojom/heap_profiling_client.mojom";
import "mojo/public/mojom/base/process_id.mojom";
// These values are persisted to logs. Entries should not be renumbered and
// numeric values should never be reused.
enum ProcessType {
OTHER = 0,
BROWSER = 1,
RENDERER = 2,
GPU = 3,
LAST = GPU
};
// This interface is how the browser process sends commands to the profiling
// process.
interface ProfilingService {
// Adds a new profiling client.
//
// The "client" interface will be for the instrumented process. It allows the
// profiling process to talk to the new process. Invokes the return callback
// with the argument `success`: whether profiling starts successfully or not.
AddProfilingClient(mojo_base.mojom.ProcessId pid,
pending_remote<ProfilingClient> client,
ProcessType process_type,
ProfilingParams params) => (bool success);
// Returns the pids of all profiled processes.
GetProfiledPids() => (array<mojo_base.mojom.ProcessId> pids);
};