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

Unified Diff: src/pdf/SkPDFDocument.cpp

Issue 2293963002: SkMakeUnique.h defines skstd::make_unique<T>(Args...) (Closed)
Patch Set: move to src/core Created 4 years, 4 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 | « src/pdf/SkPDFDevice.cpp ('k') | src/pdf/SkPDFTypes.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pdf/SkPDFDocument.cpp
diff --git a/src/pdf/SkPDFDocument.cpp b/src/pdf/SkPDFDocument.cpp
index 75c5de91e324a0dba013d9d3aa029ca6e643160c..6122dbd56573e26ec12bde528c8e915c4dbc4cad 100644
--- a/src/pdf/SkPDFDocument.cpp
+++ b/src/pdf/SkPDFDocument.cpp
@@ -5,6 +5,7 @@
* found in the LICENSE file.
*/
+#include "SkMakeUnique.h"
#include "SkPDFCanon.h"
#include "SkPDFCanvas.h"
#include "SkPDFDevice.h"
@@ -167,7 +168,6 @@ static sk_sp<SkPDFDict> generate_page_tree(SkTArray<sk_sp<SkPDFDict>>* pages) {
return std::move(curNodes[0]);
}
-template <typename T> static T* clone(const T* o) { return o ? new T(*o) : nullptr; }
////////////////////////////////////////////////////////////////////////////////
SkPDFDocument::SkPDFDocument(SkWStream* stream,
@@ -466,7 +466,7 @@ sk_sp<SkDocument> SkPDFMakeDocument(SkWStream* stream,
sk_sp<SkDocument> SkDocument::MakePDF(const char path[], SkScalar dpi) {
auto delete_wstream = [](SkWStream* stream, bool) { delete stream; };
- std::unique_ptr<SkFILEWStream> stream(new SkFILEWStream(path));
+ auto stream = skstd::make_unique<SkFILEWStream>(path);
return stream->isValid()
? SkPDFMakeDocument(stream.release(), delete_wstream, dpi,
SkDocument::PDFMetadata(), nullptr,
« no previous file with comments | « src/pdf/SkPDFDevice.cpp ('k') | src/pdf/SkPDFTypes.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698