• xiaochengh's avatar
    Fix memory leak with ScriptedIdleTaskController · 114c62b9
    xiaochengh authored
    If there is an untriggered idle task when the document is gone, it
    introduces memory leak because IdleRequestCallbackWrapper keeps a
    reference to the ScriptedIdleTaskController, making it live longer
    than the document.
    
    This patch fixes the issue by letting IdleRequestCallbackWrapper
    store a WeakPersistent instead.
    
    BUG=595155
    
    Review-Url: https://codereview.chromium.org/2618893002
    Cr-Commit-Position: refs/heads/master@{#441929}
    114c62b9
untriggered-do-not-leak.html 557 Bytes