[ios] Fixes a use-after-free in BrowsingDataRemoverImpl.
The BrowsingDataRemoverImpl needs to create a dummy WKWebView in order to remove cookies. The BrowsingDataRemoverImpl also continues to run removal tasks even after it or its BrowserState is destroyed. A completion block was incorrectly referencing an ivar, which turned out to be a garbage pointer in cases where the BrowserDataRemoverImpl had been destroyed before the completion block ran. This CL captures the ivar as a local variable before passing it to the block, avoiding the use-after-free bug. The WKWebView is captured using a strong reference, because we intentionally want it to stay alive until the block completes. BUG=818736 Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs Change-Id: Ic343e0fc1fe48db623245eec4932ceefdf954b70 Reviewed-on: https://chromium-review.googlesource.com/1022031 Commit-Queue: Rohit Rao <rohitrao@chromium.org> Reviewed-by:Eugene But <eugenebut@chromium.org> Reviewed-by:
Mohammad Refaat <mrefaat@chromium.org> Reviewed-by:
Sylvain Defresne <sdefresne@chromium.org> Cr-Commit-Position: refs/heads/master@{#552450}
Showing
Please register or sign in to comment