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

Unified Diff: core/fpdfapi/render/cpdf_scaledrenderbuffer.cpp

Issue 2571913002: Avoid the ptr.reset(new XXX()) anti-pattern (Closed)
Patch Set: rebase 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 | « core/fpdfapi/render/cpdf_renderstatus.cpp ('k') | core/fpdfapi/render/fpdf_render_loadimage.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/render/cpdf_scaledrenderbuffer.cpp
diff --git a/core/fpdfapi/render/cpdf_scaledrenderbuffer.cpp b/core/fpdfapi/render/cpdf_scaledrenderbuffer.cpp
index a14bb9ea43d18c3a104536613a9f9aa264ae16e1..bcc03ba2ddbf6c6cb7db1ccc4c247ab9ad09f597 100644
--- a/core/fpdfapi/render/cpdf_scaledrenderbuffer.cpp
+++ b/core/fpdfapi/render/cpdf_scaledrenderbuffer.cpp
@@ -10,6 +10,7 @@
#include "core/fpdfapi/render/cpdf_renderoptions.h"
#include "core/fxge/cfx_fxgedevice.h"
#include "core/fxge/cfx_renderdevice.h"
+#include "third_party/base/ptr_util.h"
#define _FPDFAPI_IMAGESIZE_LIMIT_ (30 * 1024 * 1024)
@@ -43,7 +44,7 @@ bool CPDF_ScaledRenderBuffer::Initialize(CPDF_RenderContext* pContext,
if (dpiv > max_dpi)
m_Matrix.Scale(1.0f, (FX_FLOAT)(max_dpi) / (FX_FLOAT)dpiv);
}
- m_pBitmapDevice.reset(new CFX_FxgeDevice);
+ m_pBitmapDevice = pdfium::MakeUnique<CFX_FxgeDevice>();
FXDIB_Format dibFormat = FXDIB_Rgb;
int32_t bpp = 24;
if (m_pDevice->GetDeviceCaps(FXDC_RENDER_CAPS) & FXRC_ALPHA_OUTPUT) {
« no previous file with comments | « core/fpdfapi/render/cpdf_renderstatus.cpp ('k') | core/fpdfapi/render/fpdf_render_loadimage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698