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

Unified Diff: xfa/src/fxbarcode/qrcode/BC_QRCoderDecoder.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_QRCoderDecoder.cpp
diff --git a/xfa/src/fxbarcode/qrcode/BC_QRCoderDecoder.cpp b/xfa/src/fxbarcode/qrcode/BC_QRCoderDecoder.cpp
index ebaa40fd12c112da748af2a496bb0f1b20bacb38..dd310217d4870b1ba12e11031273ef8d6d5e8c4a 100644
--- a/xfa/src/fxbarcode/qrcode/BC_QRCoderDecoder.cpp
+++ b/xfa/src/fxbarcode/qrcode/BC_QRCoderDecoder.cpp
@@ -20,12 +20,15 @@
* limitations under the License.
*/
+#include "xfa/src/fxbarcode/qrcode/BC_QRCoderDecoder.h"
+
+#include <memory>
+
#include "xfa/src/fxbarcode/common/BC_CommonBitMatrix.h"
#include "xfa/src/fxbarcode/common/BC_CommonDecoderResult.h"
#include "xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonDecoder.h"
#include "xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256.h"
#include "xfa/src/fxbarcode/qrcode/BC_QRBitMatrixParser.h"
-#include "xfa/src/fxbarcode/qrcode/BC_QRCoderDecoder.h"
#include "xfa/src/fxbarcode/qrcode/BC_QRCoderFormatInformation.h"
#include "xfa/src/fxbarcode/qrcode/BC_QRCoderVersion.h"
#include "xfa/src/fxbarcode/qrcode/BC_QRDataBlock.h"
@@ -69,9 +72,8 @@ CBC_CommonDecoderResult* CBC_QRCoderDecoder::Decode(CBC_CommonBitMatrix* bits,
CBC_QRCoderFormatInformation* temp = parser.ReadFormatInformation(e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
CBC_QRCoderErrorCorrectionLevel* ecLevel = temp->GetErrorCorrectionLevel();
- CFX_ByteArray* ba = parser.ReadCodewords(e);
+ std::unique_ptr<CFX_ByteArray> codewords(parser.ReadCodewords(e));
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
- CBC_AutoPtr<CFX_ByteArray> codewords(ba);
CFX_PtrArray* dataBlocks =
CBC_QRDataBlock::GetDataBlocks(codewords.get(), version, ecLevel, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);

Powered by Google App Engine
This is Rietveld 408576698