Fix OwnedMailbox use-after-free on destruction.
OwnedMailbox is ref counted and can outlive the GLES2Interface* it holds. This is because the callback has a scoped_refptr<OwnedMailbox> which prevents destroyed the OwnedMailbox. The ownership model for OwnedMailbox should probably be reworked, but the class will be replaced fairly soon anyways. Change callback to hold a WeakPtr instead of scoped_refptr so that OwnedMailbox gets destroyed at the correct time. OwnedMailbox is also no longer used with GLHelper and the shared main thread context, so it doesn't need to be a ContextFactoryObserver to find out about losing the shared main thread context. Delete ImageTransportFactoryTearDownBrowserTest.LoseOnTearDown which tested the now deleted functionality. Bug: 874616 Change-Id: Iab95a906c4006427e0a0046c56fe20f75d9788a6 Reviewed-on: https://chromium-review.googlesource.com/1178221 Commit-Queue: kylechar <kylechar@chromium.org> Reviewed-by:ccameron <ccameron@chromium.org> Cr-Commit-Position: refs/heads/master@{#584991}
Showing
Please register or sign in to comment