Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(115)

Side by Side Diff: chrome/browser/printing/pdf_to_emf_converter.cc

Issue 2508563003: Printing: Load the source PDF only once. (Closed)
Patch Set: More renaming Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/printing/print_preview_pdf_generated_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/printing/pdf_to_emf_converter.h" 5 #include "chrome/browser/printing/pdf_to_emf_converter.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <windows.h> 8 #include <windows.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 base::Bind(&PdfToEmfUtilityProcessHostClient::OnTempPdfReady, this, 333 base::Bind(&PdfToEmfUtilityProcessHostClient::OnTempPdfReady, this,
334 print_text_with_gdi)); 334 print_text_with_gdi));
335 } 335 }
336 336
337 void PdfToEmfUtilityProcessHostClient::OnTempPdfReady(bool print_text_with_gdi, 337 void PdfToEmfUtilityProcessHostClient::OnTempPdfReady(bool print_text_with_gdi,
338 ScopedTempFile pdf) { 338 ScopedTempFile pdf) {
339 DCHECK_CURRENTLY_ON(BrowserThread::IO); 339 DCHECK_CURRENTLY_ON(BrowserThread::IO);
340 if (!utility_process_host_ || !pdf) 340 if (!utility_process_host_ || !pdf)
341 return OnFailed(); 341 return OnFailed();
342 // Should reply with OnPageCount(). 342 // Should reply with OnPageCount().
343 Send(new ChromeUtilityMsg_RenderPDFPagesToMetafiles( 343 Send(new ChromeUtilityMsg_RenderPDFPagesToMetafiles_Start(
344 IPC::GetPlatformFileForTransit(pdf->GetPlatformFile(), false), settings_, 344 IPC::GetPlatformFileForTransit(pdf->GetPlatformFile(), false), settings_,
345 print_text_with_gdi)); 345 print_text_with_gdi));
346 } 346 }
347 347
348 void PdfToEmfUtilityProcessHostClient::OnPageCount(int page_count) { 348 void PdfToEmfUtilityProcessHostClient::OnPageCount(int page_count) {
349 DCHECK_CURRENTLY_ON(BrowserThread::IO); 349 DCHECK_CURRENTLY_ON(BrowserThread::IO);
350 if (start_callback_.is_null()) 350 if (start_callback_.is_null())
351 return OnFailed(); 351 return OnFailed();
352 BrowserThread::PostTask(BrowserThread::UI, 352 BrowserThread::PostTask(BrowserThread::UI,
353 FROM_HERE, 353 FROM_HERE,
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 541
542 PdfToEmfConverter::~PdfToEmfConverter() { 542 PdfToEmfConverter::~PdfToEmfConverter() {
543 } 543 }
544 544
545 // static 545 // static
546 std::unique_ptr<PdfToEmfConverter> PdfToEmfConverter::CreateDefault() { 546 std::unique_ptr<PdfToEmfConverter> PdfToEmfConverter::CreateDefault() {
547 return std::unique_ptr<PdfToEmfConverter>(new PdfToEmfConverterImpl()); 547 return std::unique_ptr<PdfToEmfConverter>(new PdfToEmfConverterImpl());
548 } 548 }
549 549
550 } // namespace printing 550 } // namespace printing
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/printing/print_preview_pdf_generated_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698