New issue
Advanced search Search tips

Issue 862088 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Investigate blocking window.print in unload

Project Member Reported by dcheng@chromium.org, Jul 10

Issue description

Running nested message loops when detaching is sadness. It leads to the need to write patches like https://chromium-review.googlesource.com/c/chromium/src/+/1130223 to handle the case where we try to commit a navigation to a new page in the middle of window.print!
 
Project Member

Comment 1 by bugdroid1@chromium.org, Jul 12

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/cd7f8b8a57712e9a2b2deb2a10282dea99bdb5eb

commit cd7f8b8a57712e9a2b2deb2a10282dea99bdb5eb
Author: Dmitry Gozman <dgozman@chromium.org>
Date: Thu Jul 12 19:06:57 2018

Restore some checks in FrameLoader::CommitNavigation

These were dropped when separating StartNavigation from
CommitNavigation. It's reasonable that we cannot be in StopAllLoaders
or similar unless there is a nested message loop.

See test for an example how print() triggers this stack:
...<message loop running here, dispatched CommitNavigation>...
IPC::SyncChannel::Send()
content::RenderThreadImpl::Send()
printing::PrintRenderFrameHelper::RequestPrintPreview()
content::RenderFrameImpl::ScriptedPrint()
blink::ChromeClientImpl::PrintDelegate()
blink::ChromeClient::Print()
blink::LocalDOMWindow::FinishedLoading()
blink::FrameLoader::DidFinishNavigation()
blink::Document::CheckCompleted()
blink::FrameLoader::DetachProvisionalDocumentLoader()
blink::DocumentLoader::StopLoading()
blink::DocumentLoader::DetachFromFrame()
blink::WebDocumentLoaderImpl::DetachFromFrame()
blink::FrameLoader::StopAllLoaders()
blink::LocalFrame::Detach()
blink::HTMLPlugInElement::DisconnectContentFrame()
blink::ChildFrameDisconnector::DisconnectCollectedFrameOwners()
blink::ContainerNode::WillRemoveChild()
blink::ContainerNode::RemoveChild()
...<JavaScript>...

Bug:  860208 ,  853487 , 862088
Change-Id: Ieb3f0330828f0a031a97d08cdc1ba7de8a3f0edc
Reviewed-on: https://chromium-review.googlesource.com/1130223
Commit-Queue: Dmitry Gozman <dgozman@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#574661}
[add] https://crrev.com/cd7f8b8a57712e9a2b2deb2a10282dea99bdb5eb/third_party/WebKit/LayoutTests/fast/loader/detach-while-printing-expected.txt
[add] https://crrev.com/cd7f8b8a57712e9a2b2deb2a10282dea99bdb5eb/third_party/WebKit/LayoutTests/fast/loader/detach-while-printing.html
[modify] https://crrev.com/cd7f8b8a57712e9a2b2deb2a10282dea99bdb5eb/third_party/blink/renderer/core/loader/frame_loader.cc

Sign in to add a comment