зеркало из https://github.com/electron/electron.git
More pdf printing fixes for Windows
This commit is contained in:
Родитель
32ebd9e221
Коммит
101cd90d37
|
@ -38,6 +38,11 @@ namespace printing {
|
|||
|
||||
namespace {
|
||||
|
||||
void CloseFileOnBlockingTaskRunner(base::File temp_file) {
|
||||
base::AssertBlockingAllowed();
|
||||
temp_file.Close();
|
||||
}
|
||||
|
||||
class PdfConverterImpl;
|
||||
|
||||
// Allows to delete temporary directory after all temporary files created inside
|
||||
|
@ -71,7 +76,7 @@ class TempFile {
|
|||
explicit TempFile(base::File file)
|
||||
: file_(std::move(file)),
|
||||
blocking_task_runner_(base::SequencedTaskRunnerHandle::Get()) {
|
||||
base::ThreadRestrictions::AssertIOAllowed();
|
||||
base::AssertBlockingAllowed();
|
||||
}
|
||||
~TempFile() {
|
||||
blocking_task_runner_->PostTask(
|
||||
|
|
|
@ -156,7 +156,7 @@ bool PrintingHandlerWin::RenderPdfPageToMetafile(int page_number,
|
|||
|
||||
if (!chrome_pdf::RenderPDFPageToDC(
|
||||
&pdf_data_.front(), pdf_data_.size(), page_number, metafile.context(),
|
||||
pdf_rendering_settings_.dpi,
|
||||
pdf_rendering_settings_.dpi.width(), pdf_rendering_settings_.dpi.height(),
|
||||
pdf_rendering_settings_.area.x() - offset_x,
|
||||
pdf_rendering_settings_.area.y() - offset_y,
|
||||
pdf_rendering_settings_.area.width(),
|
||||
|
|
Загрузка…
Ссылка в новой задаче