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

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

Issue 2812263002: clean up printing::Image and printing::Metafile (Closed)
Patch Set: mac effienciecies 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 | « chrome/service/service_utility_process_host.cc ('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..6ded96aa1a33b535ab1a1c02c93dde0ca4500f3c 100644
--- a/components/printing/test/mock_printer.cc
+++ b/components/printing/test/mock_printer.cc
@@ -52,7 +52,7 @@ 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) {
+ : source_size_(source_size), image_(std::move(image)) {
Lei Zhang 2017/04/13 21:21:20 I'm not 100% sure, but maybe |image| should just b
hal.canary 2017/04/13 23:57:25 you are right. good catch.
Lei Zhang 2017/04/14 00:04:33 It's a bit counter-intuitive after years of only p
// Create copies of the source data
source_data_.reset(new uint8_t[source_size]);
if (source_data_.get())
@@ -209,15 +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);
+ printing::Image image(metafile_data.memory(), params.data_size);
+ MockPrinterPage* page_data = new MockPrinterPage(
Lei Zhang 2017/04/13 21:21:20 Do we even need the |paga_data| variable?
hal.canary 2017/04/13 23:57:25 nope. Let's fix that.
+ metafile_data.memory(), params.data_size, std::move(image));
scoped_refptr<MockPrinterPage> page(page_data);
pages_.push_back(page);
#endif
« no previous file with comments | « chrome/service/service_utility_process_host.cc ('k') | printing/emf_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698