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

Unified Diff: xfa/fxbarcode/qrcode/BC_QRCoderBlockPair.h

Issue 2221023003: Use smart pointers for class owned pointers in xfa/fxbarcode (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 4 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/fxbarcode/qrcode/BC_QRCoderBlockPair.h
diff --git a/xfa/fxbarcode/qrcode/BC_QRCoderBlockPair.h b/xfa/fxbarcode/qrcode/BC_QRCoderBlockPair.h
index 5427436761d6aeb817289fc4f98cf4e31cd5c6c3..82f5ae4f288f218dc22fd46eb7f503742e7a1aa5 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();
+ CBC_CommonByteArray* GetDataBytes() const;
Lei Zhang 2016/08/09 00:23:43 Can these return const CBC_CommonByteArray* ?
Wei Li 2016/08/09 19:31:23 Done.
+ 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_

Powered by Google App Engine
This is Rietveld 408576698