Revert "Reland: Mojo EDK: Improve internal process handle ownership"

This reverts commit a9ba958ea40196b4de231fc1dffd8c6bacdb83ac.

Reason for revert: Seems there's still a leak here somewhere.

Original change's description:
> Reland: Mojo EDK: Improve internal process handle ownership
> 
> Reland of r555117 with process handle leak fixed. Original commit
> message follows.
> 
> 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.
> 
> TBR=jcivelli@chromium.org
> 
> Bug: 837612
> Change-Id: I28aaa04ca09f483e7e6f073db2edb762893a8b17
> Reviewed-on: https://chromium-review.googlesource.com/1065129
> Commit-Queue: Ken Rockot <rockot@chromium.org>
> Reviewed-by: Ken Rockot <rockot@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#559777}

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

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

Bug: 837612
Change-Id: Id0e326686cecd305f315b4a67bbda5e9f7c52b34
Reviewed-on: https://chromium-review.googlesource.com/1067051
Reviewed-by: Ken Rockot <rockot@chromium.org>
Commit-Queue: Ken Rockot <rockot@chromium.org>
Cr-Commit-Position: refs/heads/master@{#560157}

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