Chromium Code Reviews| Index: chrome/browser/printing/print_view_manager_base.cc |
| diff --git a/chrome/browser/printing/print_view_manager_base.cc b/chrome/browser/printing/print_view_manager_base.cc |
| index 26de64b5c9ba940b2f7c93ef6556dfcd35d22199..dc4e7d1770b4c3dc8851349e59bedce07cad1e30 100644 |
| --- a/chrome/browser/printing/print_view_manager_base.cc |
| +++ b/chrome/browser/printing/print_view_manager_base.cc |
| @@ -130,7 +130,7 @@ void PrintViewManagerBase::OnDidGetDocumentCookie(int cookie) { |
| void PrintViewManagerBase::OnPdfToEmfConverted( |
| const PrintHostMsg_DidPrintPage_Params& params, |
| double scale_factor, |
| - const std::vector<base::FilePath>& emf_files) { |
| + ScopedVector<Metafile>* emf_files) { |
| if (!print_job_.get()) |
| return; |
| @@ -138,20 +138,22 @@ void PrintViewManagerBase::OnPdfToEmfConverted( |
| if (!document) |
| return; |
| - for (size_t i = 0; i < emf_files.size(); ++i) { |
| - scoped_ptr<printing::Emf> metafile(new printing::Emf); |
| - if (!metafile->InitFromFile(emf_files[i])) { |
| - NOTREACHED() << "Invalid metafile"; |
| + for (size_t i = 0; i < emf_files->size(); ++i) { |
| + if (!(*emf_files)[i]) { |
| web_contents()->Stop(); |
| return; |
| } |
| + } |
| + |
| + for (size_t i = 0; i < emf_files->size(); ++i) { |
| // Update the rendered document. It will send notifications to the listener. |
| document->SetPage(i, |
| - metafile.release(), |
| + (*emf_files)[i], |
| scale_factor, |
| params.page_size, |
| params.content_area); |
| } |
| + emf_files->weak_clear(); |
|
scottmg
2014/09/08 19:06:11
Add a comment here or above SetPage that ownership
Vitaly Buka (NO REVIEWS)
2014/09/08 19:19:58
Done.
|
| ShouldQuitFromInnerMessageLoop(); |
| } |