URLLoaderFactoryGetter: Fix double free.
The class is refcounted and uses Mojo pipes. It could execute tasks as a result of Mojo callbacks after its refcount was 0, while there was a task to delete itself posted. Those tasks, if executed, would grab another reference (incrementing it from 0 to 1). That would result in use-after-frees and double deletion, once the already posted delete task was executed. This CL fixes that by getting rid of the callbacks executed from Mojo, and removing the weak reference used in another call. The downside of this approach is that Mojo errors are only lazily detected, which could result in displaying an extra error page in the case of network service crash. Bug: 870942 Change-Id: Ic7b00de6e7c623dc62098118292290666c91b1a7 Reviewed-on: https://chromium-review.googlesource.com/1164302Reviewed-by:Chong Zhang <chongz@chromium.org> Reviewed-by:
John Abd-El-Malek <jam@chromium.org> Commit-Queue: Matt Menke <mmenke@chromium.org> Cr-Commit-Position: refs/heads/master@{#582038}
Showing
Please register or sign in to comment