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

Unified Diff: printing/image.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: printing/image.cc
diff --git a/printing/image.cc b/printing/image.cc
index 1116f32e958c0b44e409284053cbe3e8c2b2c72d..4cb83e3a8a858cc1ef7d2e425867c895eb5927e1 100644
--- a/printing/image.cc
+++ b/printing/image.cc
@@ -7,6 +7,8 @@
#include "base/file_util.h"
#include "base/md5.h"
#include "base/string_number_conversions.h"
+#include "printing/native_metafile_factory.h"
+#include "base/scoped_ptr.h"
vandebo (ex-Chrome) 2011/02/23 02:01:41 order
dpapad 2011/02/24 20:56:59 Done.
#include "third_party/skia/include/core/SkColor.h"
#include "ui/gfx/codec/png_codec.h"
@@ -144,9 +146,10 @@ bool Image::LoadPng(const std::string& compressed) {
bool Image::LoadMetafile(const std::string& data) {
DCHECK(!data.empty());
- NativeMetafile metafile;
- metafile.Init(data.data(), data.size());
- return LoadMetafile(metafile);
+ scoped_ptr<NativeMetafile> metafile(
+ printing::NativeMetafileFactory::CreateMetafile());
+ metafile->Init(data.data(), data.size());
+ return LoadMetafile(*metafile.get());
}
} // namespace printing

Powered by Google App Engine
This is Rietveld 408576698