• Scott Violet's avatar
    browser: reset delegate in OnTabClosing() · d3e37e4a
    Scott Violet authored
    When OnTabClosing() is called the WebContents has been removed from the
    model. This is problematic as it's entirely likely for some of the code
    in OnTabClosing() to trigger a call back to Browser by way of a delegate
    which then expects the WebContents to be in the model. The fix is to reset
    the delegate early on in the future, so that none of the code calls back to
    Browser.
    
    TabDetachedAtImpl() also resets the delegate, but TabDetachedAtImpl() may
    be called in scenarios where OnTabClosing() is not called.
    
    BUG=1007379
    TEST=none
    
    Change-Id: I6d0141a540b39ce52725d7bc198175e1b89a40af
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1825924Reviewed-by: default avatarDana Fried <dfried@chromium.org>
    Commit-Queue: Scott Violet <sky@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#700416}
    d3e37e4a
browser.cc 111 KB