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

Unified Diff: chrome/renderer/mock_printer.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/plugin/webplugin_delegate_stub.cc ('k') | chrome/renderer/print_web_view_helper_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/mock_printer.cc
diff --git a/chrome/renderer/mock_printer.cc b/chrome/renderer/mock_printer.cc
index b579f885b3cad4330d42e5df8e7746299c550d6c..4510bfc25329382a4ee1b34f46af6d94b7e8d9a1 100644
--- a/chrome/renderer/mock_printer.cc
+++ b/chrome/renderer/mock_printer.cc
@@ -9,6 +9,8 @@
#include "chrome/common/render_messages.h"
#include "chrome/common/render_messages_params.h"
#include "ipc/ipc_message_utils.h"
+#include "printing/native_metafile_factory.h"
+#include "printing/native_metafile.h"
#include "printing/units.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -131,9 +133,10 @@ void MockPrinter::PrintPage(const ViewHostMsg_DidPrintPage_Params& params) {
base::SharedMemory metafile_data(params.metafile_data_handle, true);
#endif
metafile_data.Map(params.data_size);
- printing::NativeMetafile metafile;
- metafile.Init(metafile_data.memory(), params.data_size);
- printing::Image image(metafile);
+ scoped_ptr<printing::NativeMetafile> metafile(
+ printing::NativeMetafileFactory::CreateMetafile());
+ metafile->Init(metafile_data.memory(), params.data_size);
+ printing::Image image(*metafile);
MockPrinterPage* page_data = new MockPrinterPage(metafile_data.memory(),
params.data_size,
image);
« no previous file with comments | « chrome/plugin/webplugin_delegate_stub.cc ('k') | chrome/renderer/print_web_view_helper_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698