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

Unified Diff: components/printing/test/mock_printer.cc

Issue 2812263002: clean up printing::Image and printing::Metafile (Closed)
Patch Set: definition matches declaration Created 3 years, 8 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 | « components/printing/test/mock_printer.h ('k') | printing/emf_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/printing/test/mock_printer.cc
diff --git a/components/printing/test/mock_printer.cc b/components/printing/test/mock_printer.cc
index eb2c9c9ce86bb3f5b9630de958715ecb2b735c2a..ede214c946dbd32dfb4f6fae1e73932d322ca862 100644
--- a/components/printing/test/mock_printer.cc
+++ b/components/printing/test/mock_printer.cc
@@ -51,8 +51,8 @@ void UpdatePageSizeAndScaling(const gfx::Size& page_size,
MockPrinterPage::MockPrinterPage(const void* source_data,
uint32_t source_size,
- const printing::Image& image)
- : source_size_(source_size), image_(image) {
+ printing::Image image)
+ : source_size_(source_size), image_(std::move(image)) {
// Create copies of the source data
source_data_.reset(new uint8_t[source_size]);
if (source_data_.get())
@@ -209,16 +209,9 @@ void MockPrinter::PrintPage(const PrintHostMsg_DidPrintPage_Params& params) {
EXPECT_GT(params.data_size, 0U);
base::SharedMemory metafile_data(params.metafile_data_handle, true);
metafile_data.Map(params.data_size);
-#if defined(OS_MACOSX)
- printing::PdfMetafileCg metafile;
-#else
- printing::PdfMetafileSkia metafile(printing::PDF_SKIA_DOCUMENT_TYPE);
-#endif
- metafile.InitFromData(metafile_data.memory(), params.data_size);
- printing::Image image(metafile);
- MockPrinterPage* page_data =
- new MockPrinterPage(metafile_data.memory(), params.data_size, image);
- scoped_refptr<MockPrinterPage> page(page_data);
+ printing::Image image(metafile_data.memory(), params.data_size);
+ scoped_refptr<MockPrinterPage> page(new MockPrinterPage(
+ metafile_data.memory(), params.data_size, std::move(image)));
pages_.push_back(page);
#endif
« no previous file with comments | « components/printing/test/mock_printer.h ('k') | printing/emf_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698