Fix memory management of spellcheck callbacks on Mac
Mojo doesn't allow an unrun callback to be removed before the message pipe is closed. However, Mac spellchecker manages RequestTextCheckCallbacks as (indirectly) owned by a completion barrier in SpellingRequest, which lives independently with the message pipe. Hence, in some shutdown orders, the callback can be cleared while the message pipe is still open. This patch fixes the issue by making SpellCheckHost own all pending SpellingRequests, and SpellingRequest own RequestTextCheckCallback. Note: this patch serves as a quick fix to the regressed test cases. A follow-up patch will clean up the code. Bug: 814845 Change-Id: I22a08cdce2744b50fe23c0ff48c10d5207fa5f8b Reviewed-on: https://chromium-review.googlesource.com/946848 Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org> Reviewed-by:Rouslan Solomakhin <rouslan@chromium.org> Cr-Commit-Position: refs/heads/master@{#541624}
Showing
Please register or sign in to comment