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

Unified Diff: fpdfsdk/fpdfview.cpp

Issue 2576893002: Return unique_ptr from CXFA_FFApp::CreateDoc. (Closed)
Patch Set: Created 4 years 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 | « no previous file | fpdfsdk/fpdfxfa/cpdfxfa_context.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/fpdfview.cpp
diff --git a/fpdfsdk/fpdfview.cpp b/fpdfsdk/fpdfview.cpp
index b49be38716686246b65691c8eae14bd5a4db5305..c292384e88ba5f42ae4e7ca4c1827da5a46089bd 100644
--- a/fpdfsdk/fpdfview.cpp
+++ b/fpdfsdk/fpdfview.cpp
@@ -890,10 +890,10 @@ DLLEXPORT void STDCALL FPDF_PageToDevice(FPDF_PAGE page,
DLLEXPORT FPDF_BITMAP STDCALL FPDFBitmap_Create(int width,
int height,
int alpha) {
- std::unique_ptr<CFX_DIBitmap> pBitmap(new CFX_DIBitmap);
- if (!pBitmap->Create(width, height, alpha ? FXDIB_Argb : FXDIB_Rgb32)) {
+ auto pBitmap = pdfium::MakeUnique<CFX_DIBitmap>();
+ if (!pBitmap->Create(width, height, alpha ? FXDIB_Argb : FXDIB_Rgb32))
return nullptr;
- }
+
return pBitmap.release();
}
« no previous file with comments | « no previous file | fpdfsdk/fpdfxfa/cpdfxfa_context.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698