Commit 98818706 authored by Alexei Filippov's avatar Alexei Filippov Committed by Commit Bot

DevTools: Do not call base::Process::Pid on invalid handles

The function makes a DCHECK(IsValid()) thus causing it to crash in debug.

BUG=848398

Change-Id: I3af4495edeffff652507637e914da61dac5c5476
Reviewed-on: https://chromium-review.googlesource.com/1114182Reviewed-by: default avatarKenneth Russell <kbr@chromium.org>
Reviewed-by: default avatarDmitry Gozman <dgozman@chromium.org>
Commit-Queue: Alexei Filippov <alph@chromium.org>
Cr-Commit-Position: refs/heads/master@{#570262}
parent 5c8797c2
......@@ -190,15 +190,15 @@ void FillFrameData(base::trace_event::TracedValue* data,
node->parent()->devtools_frame_token().ToString());
if (frame_host) {
RenderProcessHost* process_host = frame_host->GetProcess();
base::ProcessId process_id = process_host->GetProcess().Pid();
if (process_id == base::kNullProcessId) {
const base::Process& process_handle = process_host->GetProcess();
if (!process_handle.IsValid()) {
data->SetString("processPseudoId", GetProcessHostHex(process_host));
frame_host->GetProcess()->PostTaskWhenProcessIsReady(
base::BindOnce(&SendProcessReadyInBrowserEvent,
node->devtools_frame_token(), process_host));
} else {
// Cast process id to int to be compatible with tracing.
data->SetInteger("processId", static_cast<int>(process_id));
data->SetInteger("processId", static_cast<int>(process_handle.Pid()));
}
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment