Commit 53646d4c authored by Ken Rockot's avatar Ken Rockot Committed by Commit Bot

Really fix ServiceProcessHost lifetime monitoring

r680551 landed a partial fix which corrected the issue specifically for
single-process mode, but the more general bug is that a
UtilityProcessHost can still call
UtilityProcessHost::Client::OnProcessTerminatedNormally() even if a
process was never launched.

This fixes the bug in all cases by ensuring that |launch_state_| is
|kLaunchComplete| before invoking OnProcessTerminatedNormally(). This
state is only set once process launch has successfully completed.

Bug: 987448
Change-Id: I5c419cdb16b8f8b67058fdad0385b499552354e3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1733011Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Commit-Queue: Ken Rockot <rockot@google.com>
Cr-Commit-Position: refs/heads/master@{#683659}
parent 83f9a13b
...@@ -225,7 +225,7 @@ UtilityProcessHost::UtilityProcessHost(std::unique_ptr<Client> client) ...@@ -225,7 +225,7 @@ UtilityProcessHost::UtilityProcessHost(std::unique_ptr<Client> client)
UtilityProcessHost::~UtilityProcessHost() { UtilityProcessHost::~UtilityProcessHost() {
DCHECK_CURRENTLY_ON(BrowserThread::IO); DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (client_ && !in_process_thread_) if (client_ && launch_state_ == LaunchState::kLaunchComplete)
client_->OnProcessTerminatedNormally(); client_->OnProcessTerminatedNormally();
} }
......
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