diff options
author | weili <weili@chromium.org> | 2016-08-09 13:45:03 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-08-09 13:45:03 -0700 |
commit | e76203dbefd1df075a063ee019c3908513f6bee5 (patch) | |
tree | 2a763852e1d1de3eee6a67285ea96be2874bfb00 /xfa/fxbarcode/qrcode/BC_QRCoderBlockPair.h | |
parent | ad5ac7584844b03c5ceed082e5f5158a632405cc (diff) | |
download | pdfium-e76203dbefd1df075a063ee019c3908513f6bee5.tar.xz |
Use smart pointers for class owned pointers in xfa/fxbarcode
For classes under xfa/fxbarcode, use smart pointers instead
of raw pointer to make memory management easier.
Also fix some styling issues along the changes.
BUG=pdfium:518
Review-Url: https://codereview.chromium.org/2221023003
Diffstat (limited to 'xfa/fxbarcode/qrcode/BC_QRCoderBlockPair.h')
-rw-r--r-- | xfa/fxbarcode/qrcode/BC_QRCoderBlockPair.h | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/xfa/fxbarcode/qrcode/BC_QRCoderBlockPair.h b/xfa/fxbarcode/qrcode/BC_QRCoderBlockPair.h index 5427436761..4259d6badd 100644 --- a/xfa/fxbarcode/qrcode/BC_QRCoderBlockPair.h +++ b/xfa/fxbarcode/qrcode/BC_QRCoderBlockPair.h @@ -7,19 +7,22 @@ #ifndef XFA_FXBARCODE_QRCODE_BC_QRCODERBLOCKPAIR_H_ #define XFA_FXBARCODE_QRCODE_BC_QRCODERBLOCKPAIR_H_ +#include <memory> + class CBC_CommonByteArray; -class CBC_QRCoderBlockPair { - private: - CBC_CommonByteArray* m_dataBytes; - CBC_CommonByteArray* m_errorCorrectionBytes; +class CBC_QRCoderBlockPair { public: - CBC_QRCoderBlockPair(CBC_CommonByteArray* data, - CBC_CommonByteArray* errorCorrection); + CBC_QRCoderBlockPair(std::unique_ptr<CBC_CommonByteArray> data, + std::unique_ptr<CBC_CommonByteArray> errorCorrection); virtual ~CBC_QRCoderBlockPair(); - CBC_CommonByteArray* GetDataBytes(); - CBC_CommonByteArray* GetErrorCorrectionBytes(); + const CBC_CommonByteArray* GetDataBytes() const; + const CBC_CommonByteArray* GetErrorCorrectionBytes() const; + + private: + std::unique_ptr<CBC_CommonByteArray> m_dataBytes; + std::unique_ptr<CBC_CommonByteArray> m_errorCorrectionBytes; }; #endif // XFA_FXBARCODE_QRCODE_BC_QRCODERBLOCKPAIR_H_ |