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

Unified Diff: xfa/src/fxbarcode/qrcode/BC_QRGridSampler.cpp

Issue 1734823002: Get rid of CBC_AutoPtr and use std::unique_ptr instead. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: rebase Created 4 years, 10 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
Index: xfa/src/fxbarcode/qrcode/BC_QRGridSampler.cpp
diff --git a/xfa/src/fxbarcode/qrcode/BC_QRGridSampler.cpp b/xfa/src/fxbarcode/qrcode/BC_QRGridSampler.cpp
index 7b9fe7b4f3f9901bf40dbce9f22043ce5ff1eb22..87f0fd072eab84662ba9ecc331eb12e4d49827df 100644
--- a/xfa/src/fxbarcode/qrcode/BC_QRGridSampler.cpp
+++ b/xfa/src/fxbarcode/qrcode/BC_QRGridSampler.cpp
@@ -20,9 +20,12 @@
* limitations under the License.
*/
+#include "xfa/src/fxbarcode/qrcode/BC_QRGridSampler.h"
+
+#include <memory>
+
#include "xfa/src/fxbarcode/common/BC_CommonBitMatrix.h"
#include "xfa/src/fxbarcode/common/BC_CommonPerspectiveTransform.h"
-#include "xfa/src/fxbarcode/qrcode/BC_QRGridSampler.h"
#include "xfa/src/fxbarcode/utils.h"
CBC_QRGridSampler CBC_QRGridSampler::m_gridSampler;
@@ -107,13 +110,12 @@ CBC_CommonBitMatrix* CBC_QRGridSampler::SampleGrid(CBC_CommonBitMatrix* image,
FX_FLOAT p4FromX,
FX_FLOAT p4FromY,
int32_t& e) {
- CBC_AutoPtr<CBC_CommonPerspectiveTransform> transform(
+ std::unique_ptr<CBC_CommonPerspectiveTransform> transform(
CBC_CommonPerspectiveTransform::QuadrilateralToQuadrilateral(
p1ToX, p1ToY, p2ToX, p2ToY, p3ToX, p3ToY, p4ToX, p4ToY, p1FromX,
p1FromY, p2FromX, p2FromY, p3FromX, p3FromY, p4FromX, p4FromY));
- CBC_CommonBitMatrix* tempBitM = new CBC_CommonBitMatrix();
- tempBitM->Init(dimensionX, dimensionY);
- CBC_AutoPtr<CBC_CommonBitMatrix> bits(tempBitM);
+ std::unique_ptr<CBC_CommonBitMatrix> bits(new CBC_CommonBitMatrix());
+ bits->Init(dimensionX, dimensionY);
CFX_FloatArray points;
points.SetSize(dimensionX << 1);
for (int32_t y = 0; y < dimensionY; y++) {

Powered by Google App Engine
This is Rietveld 408576698