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

Unified Diff: chrome/utility/utility_thread.cc

Issue 6544028: Create a Factory for NativeMetafile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed NativeMetafileFactory class comments 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
Index: chrome/utility/utility_thread.cc
diff --git a/chrome/utility/utility_thread.cc b/chrome/utility/utility_thread.cc
index 6d078e3a6edd1143a9250641235fc296d4003760..c4831b9b6bb03225eee1ba42fb0d258f09bccdb0 100644
--- a/chrome/utility/utility_thread.cc
+++ b/chrome/utility/utility_thread.cc
@@ -8,6 +8,7 @@
#include "base/file_util.h"
#include "base/path_service.h"
+#include "base/scoped_ptr.h"
#include "base/values.h"
#include "build/build_config.h"
#include "chrome/common/child_process.h"
@@ -19,6 +20,7 @@
#include "chrome/common/utility_messages.h"
#include "chrome/common/web_resource/web_resource_unpacker.h"
#include "printing/native_metafile.h"
+#include "printing/native_metafile_factory.h"
#include "printing/page_range.h"
#include "printing/units.h"
#include "third_party/skia/include/core/SkBitmap.h"
@@ -135,10 +137,14 @@ void UtilityThread::OnRenderPDFPagesToMetafile(
const std::vector<printing::PageRange>& page_ranges) {
bool succeeded = false;
#if defined(OS_WIN)
- printing::NativeMetafile metafile;
+ scoped_ptr<printing::NativeMetafile> metafile(
+ printing::MetafileFactory::GetMetafile());
int highest_rendered_page_number = 0;
- succeeded = RenderPDFToWinMetafile(pdf_file, metafile_path, render_area,
- render_dpi, page_ranges, &metafile,
+ succeeded = RenderPDFToWinMetafile(pdf_file,
+ metafile_path,
+ render_area,
+ render_dpi, page_ranges,
+ metafile.get(),
&highest_rendered_page_number);
if (succeeded) {
Send(new UtilityHostMsg_RenderPDFPagesToMetafile_Succeeded(

Powered by Google App Engine
This is Rietveld 408576698