When I tried to simulate bug 872935 by modifying my local build to have PrintRenderFrameHelper::FinalizePrintReadyDocument() always fail, I noticed the tab gets killed when I try to print preview chrome://version. The tab killing happens inside PrintPreviewHandler::ShouldReceiveRendererMessage(), which is called by PrintPreviewHandler::SendPagePreviewReady().
The issue is due to print compositing, which can delay when print preview pages are ready on the browser side. If the renderer encounters a failure, it can notify the browser before compositing finishes. So PrintPreviewHandler::OnPrintPreviewFailed() gets called first for a given preview request. OnPrintPreviewFailed() handles it and forgets about the request's existence. Then compositing finishes for a page for the same request. But since PrintPreviewHandler no longer remembers the request, it interprets the situation as though the renderer sent a bad message.
Comment 1 by bugdroid1@chromium.org
, Aug 14