This has three benefits:
1) During a MemoryDump for tracing, the ProfilingProcessHost can specify the processes for which the heap profiler should dump information. [This could also be accomplished by having the profiling process dump information for all profiled processes...that has slightly less flexibility].
2) In the chrome://memory-internals UI, we can specify which processes are already being profiled, and still show all other processes [perhaps with a "start profiling"] button.
3) The ProfilingProcessHost could keep a MemlogClient Interface for each active client, which would be useful to "flush" all clients.
The alternative would be to have the profiling process keep track of all profiled processes, and then expose this information via a mojom interface to the ProfilingProcessHost. I don't particularly care which method we apply...but we should decide on a coherent solution. I prefer the solution I listed, to minimize mojom changes and to leave the browser process "in control".
Comment 1 by benhenry@google.com
, Jan 10