summaryrefslogtreecommitdiff
path: root/xfa/fxbarcode/qrcode/BC_QRDetectorResult.h
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-04-29 13:45:14 -0700
committerCommit bot <commit-bot@chromium.org>2016-04-29 13:45:14 -0700
commite801d4e064690fbe1815d25d220cfbca79976a4f (patch)
treec7955761755597d8430b70f2e477d7b7a272f46b /xfa/fxbarcode/qrcode/BC_QRDetectorResult.h
parente7ca8ba0f76d175eb89e4cc3aa3aa2743711414e (diff)
downloadpdfium-e801d4e064690fbe1815d25d220cfbca79976a4f.tar.xz
Replace CFX_PtrArray with typesafe CFX_ArrayTemplate, part 9
Converted one place to unique_ptr to avoid redundant cleanup. Review-Url: https://codereview.chromium.org/1937593002
Diffstat (limited to 'xfa/fxbarcode/qrcode/BC_QRDetectorResult.h')
-rw-r--r--xfa/fxbarcode/qrcode/BC_QRDetectorResult.h24
1 files changed, 15 insertions, 9 deletions
diff --git a/xfa/fxbarcode/qrcode/BC_QRDetectorResult.h b/xfa/fxbarcode/qrcode/BC_QRDetectorResult.h
index 1570777afe..5948c2a01c 100644
--- a/xfa/fxbarcode/qrcode/BC_QRDetectorResult.h
+++ b/xfa/fxbarcode/qrcode/BC_QRDetectorResult.h
@@ -7,20 +7,26 @@
#ifndef XFA_FXBARCODE_QRCODE_BC_QRDETECTORRESULT_H_
#define XFA_FXBARCODE_QRCODE_BC_QRDETECTORRESULT_H_
+#include <memory>
+
#include "core/fxcrt/include/fx_basic.h"
class CBC_CommonBitMatrix;
+class CBC_ResultPoint;
-class CBC_QRDetectorResult {
- private:
- CBC_CommonBitMatrix* m_bits;
- CFX_PtrArray* m_points;
-
+class CBC_QRDetectorResult final {
public:
- CBC_QRDetectorResult(CBC_CommonBitMatrix* bits, CFX_PtrArray* points);
- virtual ~CBC_QRDetectorResult();
- CBC_CommonBitMatrix* GetBits();
- CFX_PtrArray* GetPoints();
+ // Takes ownership of |bits| and |points|.
+ CBC_QRDetectorResult(CBC_CommonBitMatrix* bits,
+ CFX_ArrayTemplate<CBC_ResultPoint*>* points);
+ ~CBC_QRDetectorResult();
+
+ CBC_CommonBitMatrix* GetBits() const;
+ CFX_ArrayTemplate<CBC_ResultPoint*>* GetPoints() const;
+
+ private:
+ std::unique_ptr<CBC_CommonBitMatrix> m_bits;
+ std::unique_ptr<CFX_ArrayTemplate<CBC_ResultPoint*>> m_points;
};
#endif // XFA_FXBARCODE_QRCODE_BC_QRDETECTORRESULT_H_