Commit 40494e0c authored by Sergey Aranovskii's avatar Sergey Aranovskii Committed by Commit Bot

Fixed crash in the fast unload controller browser tests.

This CL is consist of two patches:
1. Turn the unload controller tests on for fast unload controller.
This patchset (the file unload_browsertest.cc only) returns back
the functionality reviewed and merged on
https://chromium-review.googlesource.com/c/chromium/src/+/1012118
and reverted on
https://chromium-review.googlesource.com/c/chromium/src/+/1022553

2. Fixed crash in the fast unload controller browser tests.
The original CL was reverted because of that crash. The reason of the crash is,
the callback resets itself. The same issue has already been fixed in
the unload controller (CL https://codereview.chromium.org/471763008 ),
but not applied to the fast unload controller.
This patchset (the file fast_unload_controller.cc only) brings the missed fix.

Change-Id: I9d867131897457efad0c96bc7d2fe0ffa2a65729
Reviewed-on: https://chromium-review.googlesource.com/1025714Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#554780}
parent 17de4c97
......@@ -428,8 +428,14 @@ void FastUnloadController::ProcessPendingTabs(bool skip_beforeunload) {
}
if (is_calling_before_unload_handlers()) {
base::OnceCallback<void(bool)> on_close_confirmed = on_close_confirmed_;
// Reset |on_close_confirmed_| in case the callback tests
// |is_calling_before_unload_handlers()|, we want to return that calling
// is complete.
if (tabs_needing_unload_.empty())
on_close_confirmed_.Reset();
if (!skip_beforeunload)
on_close_confirmed_.Run(true);
std::move(on_close_confirmed).Run(true);
return;
}
......
This diff is collapsed.
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