Reduce leaks in PostTaskAndReplyImpl::PostTaskAndReply (reland #2).
This CL previously landed as https://chromium-review.googlesource.com/997892. It was reverted because of an access race in ChromeStorageImpl https://crbug.com/829122. This CL fixes the issue by deleting both callbacks on the origin sequence when they can't run. Before, there was always leak when an internal task posted by PostTaskAndReplyImpl didn't run. With this CL, PostTaskAndReplyImpl notices when its internal callbacks aren't scheduled and schedules deletion of all its internal state (including callbacks that didn't run) on the origin sequence via a DeleteSoon(). Note that a deletion scheduled via DeleteSoon() might not happen if Chrome is shutting down. R=gab@chromium.org Bug: 807013 Change-Id: I17abffd3e7afcc861c8c92dce30c14ce8629b125 Reviewed-on: https://chromium-review.googlesource.com/1006045 Commit-Queue: François Doray <fdoray@chromium.org> Reviewed-by:Gabriel Charette <gab@chromium.org> Cr-Commit-Position: refs/heads/master@{#550189}
Showing
Please register or sign in to comment