refactor: simplify child process tracking for app.getAppMetrics() (#26657)
This commit is contained in:
parent
61f339d3aa
commit
4e3e3d414d
4 changed files with 17 additions and 27 deletions
|
@ -1125,8 +1125,6 @@ void ElectronBrowserClient::RenderProcessHostDestroyed(
|
|||
|
||||
void ElectronBrowserClient::RenderProcessReady(
|
||||
content::RenderProcessHost* host) {
|
||||
render_process_host_pids_[host->GetID()] =
|
||||
base::GetProcId(host->GetProcess().Handle());
|
||||
if (delegate_) {
|
||||
static_cast<api::App*>(delegate_)->RenderProcessReady(host);
|
||||
}
|
||||
|
@ -1135,13 +1133,8 @@ void ElectronBrowserClient::RenderProcessReady(
|
|||
void ElectronBrowserClient::RenderProcessExited(
|
||||
content::RenderProcessHost* host,
|
||||
const content::ChildProcessTerminationInfo& info) {
|
||||
auto host_pid = render_process_host_pids_.find(host->GetID());
|
||||
if (host_pid != render_process_host_pids_.end()) {
|
||||
if (delegate_) {
|
||||
static_cast<api::App*>(delegate_)->RenderProcessDisconnected(
|
||||
host_pid->second);
|
||||
}
|
||||
render_process_host_pids_.erase(host_pid);
|
||||
if (delegate_) {
|
||||
static_cast<api::App*>(delegate_)->RenderProcessExited(host);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue