Commit 0e3d484a authored by sangwoo.ko's avatar sangwoo.ko Committed by Commit Bot

Don't send 'detached' notification if unload handler is triggered

When we try closing tabs, there might be 'unload handler' on them.
In this case, we should wait for the result. So in this case,
there's no closed web contents detached.

Bug: 842194
Change-Id: I78b0d9f8d42631b1309f4baa8dbbfa9503564426
Reviewed-on: https://chromium-review.googlesource.com/1248883Reviewed-by: default avatarErik Chen <erikchen@chromium.org>
Commit-Queue: Sang Woo Ko <sangwoo108@chromium.org>
Cr-Commit-Position: refs/heads/master@{#595375}
parent 6f069941
......@@ -1456,7 +1456,10 @@ bool TabStripModel::CloseWebContentses(
notifications.detached_web_contents.push_back(std::move(dwc));
}
SendDetachWebContentsNotifications(&notifications);
// When unload handler is triggered for all items, we should wait for the
// result.
if (!notifications.detached_web_contents.empty())
SendDetachWebContentsNotifications(&notifications);
return closed_all;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment