Reland "Fix invalid handle errors found with App Verifier"
This is a reland of c31de326. The CHECK that was triggering (crbug.com/868341) has been removed but the change is otherwise the same. The CHECK will be readded once all of the bugs that it reveals are fixed (crbug.com/869154) Original change's description: > Fix invalid handle errors found with App Verifier > > ChildProcessData was holding a raw ProcessHandle which meant that there > was no guarantee that the handle would be valid when it was used. This > change switches to a ScopedHandle on Windows, with the associated > duplication of the handle, so that it is guaranteed to be valid. This > fixes a frequently encountered use of an invalid handle that was > detected by Application Verifier. This change also adds a CHECK to > base::GetProcId to check for use of invalid handles even when not using > Application Verifier. > > ChildProcessData::handle is now a private member so all references to > it were updated to use accessors. > > When ChildProcessData::SetHandle is called the handle is duplicated. > When a ChildProcessData object needs to be copied an explicit > Duplicate function is called. > > An IsHandleValid helper function was added. > > An invalid test was removed because it was triggering the CHECK in > base::GetProcId. > > Bug: 417532,821453,865805 > Change-Id: I7e38140335c0140536919341f011f144f150c88f > Reviewed-on: https://chromium-review.googlesource.com/1145767 > Commit-Queue: Bruce Dawson <brucedawson@chromium.org> > Reviewed-by: Jochen Eisinger <jochen@chromium.org> > Cr-Commit-Position: refs/heads/master@{#578419} Bug: 417532, 821453, 865805, 868341, 869154 Change-Id: I022982f447cce4649618f4413e960f5639ad750a Reviewed-on: https://chromium-review.googlesource.com/1155498Reviewed-by:Jochen Eisinger <jochen@chromium.org> Commit-Queue: Bruce Dawson <brucedawson@chromium.org> Cr-Commit-Position: refs/heads/master@{#579454}
Showing
Please register or sign in to comment