From e5b78a54cf9e8a356fcc41c4731f963ab95b6e51 Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Mon, 26 Mar 2018 17:00:11 -0400 Subject: [PATCH] Update to Chromium version 65.0.3325.181 --- CHROMIUM_BUILD_COMPATIBILITY.txt | 2 +- .../browser/printing/print_view_manager_base.cc | 17 +++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/CHROMIUM_BUILD_COMPATIBILITY.txt b/CHROMIUM_BUILD_COMPATIBILITY.txt index 59a3fcd12..6b4b1cbdb 100644 --- a/CHROMIUM_BUILD_COMPATIBILITY.txt +++ b/CHROMIUM_BUILD_COMPATIBILITY.txt @@ -7,5 +7,5 @@ # https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding { - 'chromium_checkout': 'refs/tags/65.0.3325.146', + 'chromium_checkout': 'refs/tags/65.0.3325.181', } diff --git a/libcef/browser/printing/print_view_manager_base.cc b/libcef/browser/printing/print_view_manager_base.cc index d5aca5b9b..96e065067 100644 --- a/libcef/browser/printing/print_view_manager_base.cc +++ b/libcef/browser/printing/print_view_manager_base.cc @@ -120,6 +120,11 @@ void CefPrintViewManagerBase::PrintDocument( print_job_->StartPdfToEmfConversion(print_data, page_size, content_area, print_text_with_gdi); } + // Indicate that the PDF is fully rendered and we no longer need the renderer + // and web contents, so the print job does not need to be cancelled if they + // die. This is needed on Windows because the PrintedDocument will not be + // considered complete until PDF conversion finishes. + document->SetConvertingPdf(); #else std::unique_ptr metafile = std::make_unique(SkiaDocumentType::PDF); @@ -346,18 +351,18 @@ bool CefPrintViewManagerBase::RenderAllMissingPagesNow() { if (!print_job_.get() || !print_job_->is_job_pending()) return false; - // We can't print if there is no renderer. - if (!web_contents() || !web_contents()->GetRenderViewHost() || - !web_contents()->GetRenderViewHost()->IsRenderViewLive()) { - return false; - } - // Is the document already complete? if (print_job_->document() && print_job_->document()->IsComplete()) { printing_succeeded_ = true; return true; } + // We can't print if there is no renderer. + if (!web_contents() || !web_contents()->GetRenderViewHost() || + !web_contents()->GetRenderViewHost()->IsRenderViewLive()) { + return false; + } + // WebContents is either dying or a second consecutive request to print // happened before the first had time to finish. We need to render all the // pages in an hurry if a print_job_ is still pending. No need to wait for it