fix: check for shared memory handle validity before closing, remove DebugDumpData call (#15402)

This commit is contained in:
Heilig Benedek 2018-10-26 16:57:03 +02:00 committed by Charles Kerr
parent 41e86efda0
commit bdda248194
2 changed files with 3 additions and 2 deletions

View file

@ -165,7 +165,6 @@ void PrintViewManagerBase::OnDidPrintPage(
reinterpret_cast<const unsigned char*>(shared_buf.memory()), reinterpret_cast<const unsigned char*>(shared_buf.memory()),
params.data_size); params.data_size);
document->DebugDumpData(bytes.get(), FILE_PATH_LITERAL(".pdf"));
print_job_->StartPdfToEmfConversion( print_job_->StartPdfToEmfConversion(
bytes, params.page_size, params.content_area, print_text_with_gdi); bytes, params.page_size, params.content_area, print_text_with_gdi);
} }

View file

@ -106,7 +106,9 @@ bool PrintWebViewHelper::PrintPagesNative(blink::WebLocalFrame* frame,
printed_page_params.content_area = content_area_in_dpi[i]; printed_page_params.content_area = content_area_in_dpi[i];
Send(new PrintHostMsg_DidPrintPage(routing_id(), printed_page_params)); Send(new PrintHostMsg_DidPrintPage(routing_id(), printed_page_params));
// Send the rest of the pages with an invalid metafile handle. // Send the rest of the pages with an invalid metafile handle.
if (printed_page_params.metafile_data_handle.IsValid()) {
printed_page_params.metafile_data_handle.Close(); printed_page_params.metafile_data_handle.Close();
}
printed_page_params.metafile_data_handle = base::SharedMemoryHandle(); printed_page_params.metafile_data_handle = base::SharedMemoryHandle();
} }
return true; return true;