• Ken Rockot's avatar
    Fix Resource Coordinator client registration · 8cb47e19
    Ken Rockot authored
    Child processes send a message to BrowserChildProcessHostImpl to
    have the host register Resource Coordinator client pipes on their
    behalf.
    
    The implementation of this message accesses the corresponding
    ChildProcessLauncher's PID indiscriminately. Meanwhile the process
    may have died by the time the message is actually dispatched, and
    it's invalid to access that PID after process termination.
    
    While this race doesn't seem to affect security or stability of
    production code in practice, it does cause browser tests to hit
    a DCHECK on PID access, causing fairly common flake.
    
    This fixes the race by ensuring the Process is still valid before
    attempting to grab its PID.
    
    Fixed: 1029627
    Change-Id: I3f8eb6e9f6cd5c94c4011b76446e7fce63c0d12c
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1944618Reviewed-by: default avatarJohn Abd-El-Malek <jam@chromium.org>
    Commit-Queue: Ken Rockot <rockot@google.com>
    Cr-Commit-Position: refs/heads/master@{#721726}
    8cb47e19
browser_child_process_host_impl.cc 25.6 KB