Simplify EnsureProcessTerminated() implementations.

EnsureProcessTerminated() is used by a parent process to ensure that a
child process it expects should exit "soon" actually does so. The child
process is asynchronously monitored, and forcibly terminated if it
fails to exit in a timely manner. Under POSIX platforms the child
process Id is also reaped with waitpid(), to release its exited
"zombie" process structure.

We had ended up with separate implementations for each platform, each
with different properties.

This CL makes the following changes:
- Reimplements POSIX EnsureProcessTerminated using base::Process.
- Provides a common implementation for platforms on which there is no
  need to waitpid() to cleanup zombie processes.

The Mac specialization will be replaced with an asynchronous
implementation in a subsequent patch.

Bug: 806451, 750756
Change-Id: If251dc13e7ad0a0cffb4f1921897a89305d6cb21
Reviewed-on: https://chromium-review.googlesource.com/920799
Commit-Queue: Wez <wez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Reviewed-by: Bo <boliu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#547508}

CrOS-Libchrome-Original-Commit: c18a57c2b9c89230c5f67d2a06ec527499db0cfd
5 files changed
tree: 0d1363ea71e23febe6066a189377f952c5daa8ba
  1. base/
  2. build/
  3. components/
  4. dbus/
  5. device/
  6. ipc/
  7. mojo/
  8. testing/
  9. third_party/
  10. ui/