Commit a647637f authored by Daniel Cheng's avatar Daniel Cheng Committed by Commit Bot

Flush microtask queue in DocumentLoader::DetachFromFrame later.

ResourceFetcher::ClearContext() can actually queue microtasks; for
example, pending FontFace loads will be cancelled and reject the
associated promise.

Bug: 907270
Change-Id: I83b18924d494052dad021fb3d8bd427de1b9c40c
Reviewed-on: https://chromium-review.googlesource.com/c/1347095Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#610309}
parent fcbc2e83
......@@ -878,6 +878,7 @@ void DocumentLoader::StopLoading() {
void DocumentLoader::DetachFromFrame(bool flush_microtask_queue) {
DCHECK(frame_);
StopLoading();
fetcher_->ClearContext();
if (flush_microtask_queue) {
// Flush microtask queue so that they all run on pre-navigation context.
// TODO(dcheng): This is a temporary hack that should be removed. This is
......@@ -893,7 +894,6 @@ void DocumentLoader::DetachFromFrame(bool flush_microtask_queue) {
Microtask::PerformCheckpoint(V8PerIsolateData::MainThreadIsolate());
}
ScriptForbiddenScope forbid_scripts;
fetcher_->ClearContext();
// If that load cancellation triggered another detach, leave.
// (fast/frames/detach-frame-nested-no-crash.html is an example of this.)
......
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