Introduce MiniFile, a simple wrapper around a file handle.
Resource extraction and file expansion in the mini_installer now use the MiniFile class to manage output files while they are open. It takes care of handle lifetime management and provides a robust way to delete an open file. This change also fixes two potential file leaks. Specifically, a destination file created by either PEResource::WriteToDisk or mini_installer::Expand is now deleted in case of error. BUG=516207 Change-Id: I2ee894d4e6f2d04fbb6cf3355638ee50e8bb1bf9 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2303400Reviewed-by:Will Harris <wfh@chromium.org> Commit-Queue: Greg Thompson <grt@chromium.org> Cr-Commit-Position: refs/heads/master@{#790547}
Showing
Please register or sign in to comment