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

Unified Diff: src/pdf/SkPDFDevice.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/SkDeflate.cpp ('k') | src/pdf/SkPDFDocument.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pdf/SkPDFDevice.cpp
diff --git a/src/pdf/SkPDFDevice.cpp b/src/pdf/SkPDFDevice.cpp
index 24df879a9d1b27b6318feb96ece87ace73aa3563..e92990317c0d301a8bbdb47522e9563bb6ce61bb 100644
--- a/src/pdf/SkPDFDevice.cpp
+++ b/src/pdf/SkPDFDevice.cpp
@@ -13,6 +13,7 @@
#include "SkColorFilter.h"
#include "SkDraw.h"
#include "SkGlyphCache.h"
+#include "SkMakeUnique.h"
#include "SkPath.h"
#include "SkPathEffect.h"
#include "SkPathOps.h"
@@ -1344,11 +1345,11 @@ std::unique_ptr<SkStreamAsset> SkPDFDevice::content() const {
entry.fContent.writeToStream(&buffer);
}
gsState.drainStack();
-
- return std::unique_ptr<SkStreamAsset>(
- buffer.bytesWritten() > 0
- ? buffer.detachAsStream()
- : new SkMemoryStream);
+ if (buffer.bytesWritten() > 0) {
+ return std::unique_ptr<SkStreamAsset>(buffer.detachAsStream());
+ } else {
+ return skstd::make_unique<SkMemoryStream>();
+ }
}
/* Draws an inverse filled path by using Path Ops to compute the positive
« no previous file with comments | « src/pdf/SkDeflate.cpp ('k') | src/pdf/SkPDFDocument.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698