New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 636642 link

Starred by 2 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Chrome , Mac
Pri: 1
Type: Bug

Blocking:
issue 563683



Sign in to add a comment

NOTREACHED() in ChromePrintWebViewHelperDelegate::GetPdfElement()

Project Member Reported by thestig@chromium.org, Aug 11 2016

Issue description

What steps will reproduce the problem?
(1) In a debug build, run chrome /path/to/foo.pdf
(2) Before foo.pdf has a chance to load, quickly press ctrl + p

Expected: PDF prints / print previews
Actual: Renderer code execution hits the NOTREACHED() in ChromePrintWebViewHelperDelegate::GetPdfElement().
 
And sometimes, depending on timing, I can get: if (inside_print_preview || inside_pdf_extension) to evaluate to false, in which case, the print preview comes out as all black.
w.r.t. comment 1 - when that happens, |inside_pdf_extension| evals to false because the URL for the |frame| is still file:///path/to/foo.pdf. This sounds familiar.
Labels: -Pri-2 Pri-1
This issue is blocking work on ARC print support.
Cc: bartfab@chromium.org
The comment 1 issue sounds like the wrong WebContents got picked. The original bug report is the PDF plugin not getting created yet. For the original problem, if we know we are trying to print a PDF, the two ways I see of going about it are:

a) Go about it similar to pp::PDF::HasUnsupportedFeature() -> PpapiHostMsg_PDF_HasUnsupportedFeature -> epperPDFHost::OnHostMsgHasUnsupportedFeature() -> PDFHostMsg_PDFHasUnsupportedFeature -> PDFWebContentsHelper::OnHasUnsupportedFeature().

In PDFWebContentsHelper, it has a WebContents* and a client, so it can trigger an event of sorts and from there...
- ARC can somehow watch for this event before calling print.
- Manual printing can queue the print command for PDFs until this event triggers.

b) Enable HS PDFScriptingAPI for all plugins in general, not just the ones inside print preview. Then add a callback for "documentLoaded" and somehow plumb a JS callback out to C++ and then eventually out to the browser? The rest is similar to (a).
I think in (a) we don't need to distinguish ARC and manual printing cases as both of them have the same issue - renderer code hits NOTREACHED() in ChromePrintWebViewHelperDelegate::GetPdfElement().
So, the solution could be to wait in GetPdfElement() until an event from PDFWebContentsHelper if it's sure that PDF is expected - the same line where it hits NOTREACHED() now.
Cc: thestig@chromium.org
Owner: poromov@chromium.org

Comment 8 by npm@chromium.org, Oct 24 2016

Status: Assigned (was: Untriaged)
Cc: arthurso...@chromium.org
I have probably reproduced the same bug with the following steps. It doesn't depend on the timing though.
(1) Go to chrome://print
(2) Press ctrl + p (when you want)

=> NOTREACHED() in ChromePrintWebViewHelperDelegate::GetPdfElement().
Owner: vkuzkokov@chromium.org
Blocking: 563683
Cc: -bartfab@chromium.org -poromov@chromium.org
Owner: skau@chromium.org
Status: Untriaged (was: Assigned)
Sean, this should probably live on Chrome OS Printing team. We don't have resources to work on this bug. 
Feel free to re-assign to better owner, I'm setting status to "Untriaged".

Comment 13 by skau@chromium.org, Jan 30 2018

Cc: skau@chromium.org
Owner: valleau@chromium.org
Status: Assigned (was: Untriaged)

Sign in to add a comment