PluginResourceThrottle to use WeakPtr to MimeHandlerViewContainerBase
This is a second attempt at fixing the crash linked in the bug. It appears that PluginResourceThrottle's lifetime is tied with WebURLLoaderImpl does not synchronously go away with the container. When an <embed> element is removed during a resource request, the MHVCBase (aka WebAssociatedURLLoaderClient in this context) is destroyed immediately. The WebURLLoaderImpl, OTH, goes away when the cancel timer on the ResourceClient is fired. To avoid any potential UaF, this CL changes the raw pointer refernece to MHVCBase in PluginResourceThrottle to a WeakPtr. This also serves as a potential fix for the crashes in the linked bug. Bug: 878359 Change-Id: If8b21f9366bb57394819946e891f9288028dde2c Reviewed-on: https://chromium-review.googlesource.com/1230576Reviewed-by:James MacLean <wjmaclean@chromium.org> Reviewed-by:
Ehsan Karamad <ekaramad@chromium.org> Commit-Queue: Ehsan Karamad <ekaramad@chromium.org> Cr-Commit-Position: refs/heads/master@{#592114}
Showing
Please register or sign in to comment