Simplify Frame::Swap() to only use Detach().
Frame::Swap() would previously call DetachDocument(), save some state, and then complete detaching old frame by calling Detach(). However, this left the old frame in a semi-inconsistent state between DetachDocument() and Detach() and could trigger some weird edge cases (such as in the printing code). Instead, since Detach() already takes a FrameDetachType, improve the coordination between Detach() and Swap() so that detaching a frame for swap preserves the state that Swap() will adopt. By doing this, Frame::Swap() no longer needs to call DetachDocument() at all. Bug: 1061686, 1063150 Change-Id: I937bbf9d0a6d0de911aa4bd4743a16b86df1b4f4 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2597169Reviewed-by:danakj <danakj@chromium.org> Reviewed-by:
Yuki Shiino <yukishiino@chromium.org> Commit-Queue: Daniel Cheng <dcheng@chromium.org> Cr-Commit-Position: refs/heads/master@{#839626}
Showing
Please register or sign in to comment