• Scott Violet's avatar
    weblayer: reorder tab calls · c3ebff7a
    Scott Violet authored
    This patch changes the order of calls to the client when a Tab is
    destroyed. Prior to this patch the order was onTabDestroyed then
    onTabRemoved. This patch makes the order onTabRemoved() then
    onTabDestroyed(). The order was like this at one point, but
    without tests it regressed. This adds a test to ensure that doesn't
    happen again.
    
    Calling onTabDestroyed() first is problematic as it means client code
    can't call any methods on Tab as it's been destroyed, which is error
    prone and surprising.
    
    This also ensures calling Tab.destroy() removes the Tab from the
    internal map in the client library. This previously would not happen
    if Browser.destroyTab() was called.
    
    BUG=none
    TEST=covered by tests
    
    Change-Id: Ic3e38cee0eee70ef9b2cfced83deca71729fdd5b
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2411161Reviewed-by: default avatarClark DuVall <cduvall@chromium.org>
    Commit-Queue: Scott Violet <sky@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#807098}
    c3ebff7a
browser_impl.h 5.01 KB