• Xiaocheng Hu's avatar
    Fix memory management of spellcheck callbacks on Mac · 62233ab4
    Xiaocheng Hu authored
    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: default avatarRouslan Solomakhin <rouslan@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#541624}
    62233ab4
spell_check_host_chrome_impl.h 3.79 KB