Index: webkit/plugins/ppapi/ppapi_plugin_instance.cc |
diff --git a/webkit/plugins/ppapi/ppapi_plugin_instance.cc b/webkit/plugins/ppapi/ppapi_plugin_instance.cc |
index 075630863a30d837bc124f06ff51c78a19b2d717..e6bd0c0d01c8b4e8f4a9ad4394d254486be49de4 100644 |
--- a/webkit/plugins/ppapi/ppapi_plugin_instance.cc |
+++ b/webkit/plugins/ppapi/ppapi_plugin_instance.cc |
@@ -1190,10 +1190,11 @@ bool PluginInstance::PrintPDFOutput(PP_Resource print_output, |
ret = metafile->InitFromData(buffer->mapped_buffer(), buffer->size()); |
canvas->endPlatformPaint(); |
#elif defined(OS_MACOSX) |
- scoped_ptr<printing::NativeMetafile> metafile( |
- printing::NativeMetafileFactory::Create()); |
// Create a PDF metafile and render from there into the passed in context. |
- if (metafile->InitFromData(buffer->mapped_buffer(), buffer->size())) { |
+ scoped_ptr<printing::NativeMetafile> metafile( |
+ printing::NativeMetafileFactory::CreateFromData(buffer->mapped_buffer(), |
+ buffer->size())); |
+ if (metafile.get() != NULL) { |
// Flip the transform. |
CGContextSaveGState(canvas); |
CGContextTranslateCTM(canvas, 0, |