• Ken Rockot's avatar
    Revert "Mojo EDK: Improve internal process handle ownership" · 2f8cd83e
    Ken Rockot authored
    This reverts commit 27c99670.
    
    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/1057699Reviewed-by: default avatarJay Civelli <jcivelli@chromium.org>
    Reviewed-by: default avatarKen Rockot <rockot@chromium.org>
    Commit-Queue: Ken Rockot <rockot@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#558388}
    2f8cd83e
channel.cc 25.9 KB