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

Unified Diff: chrome/browser/printing/print_view_manager_base.cc

Issue 547203002: Delete temporarily dir for PDF to EMF conversion after all EMF files closed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mon Sep 8 12:19:46 PDT 2014 Created 6 years, 3 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/printing/print_view_manager_base.h ('k') | printing/emf_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..45f34df0e87259733ad3756497a94855f3e5a3e5 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,23 @@ 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);
}
+ // document->SetPage took ownership of all EMFs.
+ emf_files->weak_clear();
ShouldQuitFromInnerMessageLoop();
}
« no previous file with comments | « chrome/browser/printing/print_view_manager_base.h ('k') | printing/emf_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698