[SuperSize] Fix file handle usage for .sizediff files.
Previously, SaveDeltaSizeInfo() and LoadDeltaSizeInfo() take an optional |file_obj| parameter, and uses it in a "with" block. This causes the inject |file_obj| to get closed. This side-effect is undesirable for the usual usage pattern of callers lending |file_obj| to functions. This CL fixes the issue by using a one-level recursion to create |file_obj| if it's not provided. Change-Id: I2132aea64bb29edd49576dbaa4b0797a6afb80f7 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2425224 Commit-Queue: Samuel Huang <huangs@chromium.org> Reviewed-by:Andrew Grieve <agrieve@chromium.org> Cr-Commit-Position: refs/heads/master@{#810099}
Showing
Please register or sign in to comment