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

Unified Diff: chrome/service/service_utility_process_host.cc

Issue 6544028: Create a Factory for NativeMetafile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ARM compile failure fix Created 9 years, 10 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/renderer/webplugin_delegate_proxy.cc ('k') | chrome/utility/utility_thread.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/service/service_utility_process_host.cc
diff --git a/chrome/service/service_utility_process_host.cc b/chrome/service/service_utility_process_host.cc
index b63e27f9d7f8661de5f11428c9effe780a826320..a340d8d394e6b248bafe41a932550c5862bc3496 100644
--- a/chrome/service/service_utility_process_host.cc
+++ b/chrome/service/service_utility_process_host.cc
@@ -13,13 +13,15 @@
#include "chrome/common/chrome_switches.h"
#include "chrome/common/utility_messages.h"
#include "ipc/ipc_switches.h"
-#include "printing/native_metafile.h"
#include "printing/page_range.h"
#include "ui/base/ui_base_switches.h"
#include "ui/gfx/rect.h"
#if defined(OS_WIN)
+#include "base/scoped_ptr.h"
#include "base/win/scoped_handle.h"
+#include "printing/native_metafile_factory.h"
+#include "printing/native_metafile.h"
#endif
ServiceUtilityProcessHost::ServiceUtilityProcessHost(
@@ -202,13 +204,15 @@ void ServiceUtilityProcessHost::Client::MetafileAvailable(
if (!scratch_metafile_dir.Set(metafile_path.DirName()))
LOG(WARNING) << "Unable to set scratch metafile directory";
#if defined(OS_WIN)
- printing::NativeMetafile metafile;
- if (!metafile.CreateFromFile(metafile_path)) {
+ scoped_ptr<printing::NativeMetafile> metafile(
+ printing::NativeMetafileFactory::CreateMetafile());
+ if (!metafile->CreateFromFile(metafile_path)) {
OnRenderPDFPagesToMetafileFailed();
} else {
- OnRenderPDFPagesToMetafileSucceeded(metafile, highest_rendered_page_number);
+ OnRenderPDFPagesToMetafileSucceeded(*metafile,
+ highest_rendered_page_number);
// Close it so that ScopedTempDir can delete the folder.
- metafile.CloseEmf();
+ metafile->CloseEmf();
}
#endif // defined(OS_WIN)
}
« no previous file with comments | « chrome/renderer/webplugin_delegate_proxy.cc ('k') | chrome/utility/utility_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698