WebLayer: Close tabs on launching external intents when instructed
This CL augments WebLayer with closing of tabs when the external intent launching code asks to do so (namely, when an initial navigation in a Tab results in the launch of an external intent). To do so we invoke BrowserImpl#destroyTab(). As clients < 84 are not necessarily expecting the last tab to be closed by the WebLayer implementation, we do this only when the client is 84+. As part of this CL we looked at hardening WebLayer against the case where the client calls Browser#destroyTab() from within TabListCallback#onTabRemoved() (which itself is received after the Tab destruction process has started in the implementation). It turns out that WebLayer will already fail fast in this case: Browser#onTabRemoved() sets the removed Tab's Browser to null, and Browser#destroyTab() raises an exception if the passed-in Tab's Browser is not equal to |this|. Bug: 1031465 Change-Id: I87e1464d3be4b0fe138ab7aa14fe700b8b930722 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2144120 Commit-Queue: Colin Blundell <blundell@chromium.org> Reviewed-by:Scott Violet <sky@chromium.org> Reviewed-by:
Bo <boliu@chromium.org> Cr-Commit-Position: refs/heads/master@{#759969}
Showing
Please register or sign in to comment