Revert "Mojo EDK: Improve internal process handle ownership"

This reverts commit 27c9967014302ecc77c888a8628773f53a830e5c.

Reason for revert: https://crbug.com/841565

Original change's description:
> Mojo EDK: Improve internal process handle ownership
> 
> Mojo passes around base::ProcessHandle values for various reasons. On
> most systems this is fine, but at least on Windows, a ProcessHandle
> refers to an owned reference to a system process object, and if not
> careful it's possible for a base::ProcessHandle value to inadvertently
> change meaning over time.
> 
> This CL introduces the concept of a move-only ScopedProcessHandle
> within Mojo, which on most platforms is just a base::PlatformHandle.
> On Windows, this represents an owned base::ProcessHandle which closes
> on destruction and clones correctly using DuplicateHandle rather than
> merely copying the raw handle value.
> 
> ScopedProcessHandle is used in a few places where process handle
> ownership semantics were previously weaker than necessary, or were
> correct but implemented ad hoc.
> 
> This also updates ScopedPlatformHandle (and supporting code like
> Channel::RewriteHandles) such that the |owning_process| field (if not
> the current process) is always an owned process handle. This ensures
> that when such handles are closed in unsent messages, they can be
> safely closed in the target process (from within the source process)
> without any risk of raciness against target process termination.
> 
> Bug: 837612
> Change-Id: I943bb5f70ede56351d52b2ecea7d76fcfdee46ce
> Reviewed-on: https://chromium-review.googlesource.com/1036459
> Reviewed-by: Jay Civelli <jcivelli@chromium.org>
> Commit-Queue: Ken Rockot <rockot@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#555117}

TBR=jcivelli@chromium.org,rockot@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 837612
Change-Id: Ief6e1d6d6f2f96dc7420e06d8438cc06cbf17490
Reviewed-on: https://chromium-review.googlesource.com/1057699
Reviewed-by: Jay Civelli <jcivelli@chromium.org>
Reviewed-by: Ken Rockot <rockot@chromium.org>
Commit-Queue: Ken Rockot <rockot@chromium.org>
Cr-Commit-Position: refs/heads/master@{#558388}

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