Delay sending TabDetachedAt and TabClosingAt observer notifications.
Previously, the notifications were sent during the tab-close-loop [if multiple tabs were being closed]. This made reentrancy particularly dangerous. The logic in Browser::TabDetachedAt and Browser::TabInsertedAt relied on the |index| parameter to determine whether the index of the active tab has changed [for which there is no notification]. This CL changes those methods to always call SessionService::SetSelectedTabInWindow, and modifies SessionService::SetSelectedTabInWindow to be idempotent. Bug: 842194 Change-Id: I2fc54749e495ab9c925bdba89ef857c4ea3537d9 Reviewed-on: https://chromium-review.googlesource.com/1055732Reviewed-by:Scott Violet <sky@chromium.org> Commit-Queue: Erik Chen <erikchen@chromium.org> Cr-Commit-Position: refs/heads/master@{#558530}
Showing
Please register or sign in to comment