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

Unified Diff: src/pdf/SkPDFMetadata.cpp

Issue 1773033002: SkPDF: use sk_make_sp<T> when it makes sense. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2016-03-08 (Tuesday) 06:54:33 EST Created 4 years, 9 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/SkPDFGraphicState.cpp ('k') | src/pdf/SkPDFResourceDict.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pdf/SkPDFMetadata.cpp
diff --git a/src/pdf/SkPDFMetadata.cpp b/src/pdf/SkPDFMetadata.cpp
index 387bde1be76610922685cc8bdb2b1ef49706c182..5e8c124d7b6cb5d3351d4f095710ffd83fc061c0 100644
--- a/src/pdf/SkPDFMetadata.cpp
+++ b/src/pdf/SkPDFMetadata.cpp
@@ -28,7 +28,7 @@ static SkString pdf_date(const SkTime::DateTime& dt) {
}
SkPDFObject* SkPDFMetadata::createDocumentInformationDict() const {
- sk_sp<SkPDFDict> dict(new SkPDFDict);
+ auto dict = sk_make_sp<SkPDFDict>();
static const char* keys[] = {
"Title", "Author", "Subject", "Keywords", "Creator"};
for (const char* key : keys) {
@@ -86,7 +86,7 @@ SkPDFMetadata::UUID SkPDFMetadata::uuid() const {
SkPDFObject* SkPDFMetadata::CreatePdfId(const UUID& doc, const UUID& instance) {
// /ID [ <81b14aafa313db63dbd6f981e49f94f4>
// <81b14aafa313db63dbd6f981e49f94f4> ]
- sk_sp<SkPDFArray> array(new SkPDFArray);
+ auto array = sk_make_sp<SkPDFArray>();
static_assert(sizeof(UUID) == 16, "uuid_size");
array->appendString(
SkString(reinterpret_cast<const char*>(&doc), sizeof(UUID)));
« no previous file with comments | « src/pdf/SkPDFGraphicState.cpp ('k') | src/pdf/SkPDFResourceDict.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698