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

Unified Diff: xfa/src/fxbarcode/utils.h

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/utils.h
diff --git a/xfa/src/fxbarcode/utils.h b/xfa/src/fxbarcode/utils.h
index 37d2ce775b92ab4d8e33ede285d4782ab25cbac5..23830d5656fe915884dc2b363267ef7f764db7f9 100644
--- a/xfa/src/fxbarcode/utils.h
+++ b/xfa/src/fxbarcode/utils.h
@@ -19,44 +19,7 @@ void BC_FX_ByteString_Append(CFX_ByteString& dst, int32_t count, FX_CHAR c);
void BC_FX_ByteString_Append(CFX_ByteString& dst, const CFX_ByteArray& ba);
typedef FX_BOOL (*BC_PtrArrayCompareCallback)(void* l, void* r);
void BC_FX_PtrArray_Sort(CFX_PtrArray& src, BC_PtrArrayCompareCallback fun);
-template <class _Ty>
-class CBC_AutoPtr {
- public:
- typedef _Ty element_type;
- explicit CBC_AutoPtr(_Ty* _P = 0) : _Owns(_P != 0), _Ptr(_P) {}
Lei Zhang 2016/02/25 02:19:24 BTW, this whole CL started because my local Androi
- CBC_AutoPtr(const CBC_AutoPtr<_Ty>& _Y)
- : _Owns(_Y._Owns), _Ptr(_Y.release()) {}
- CBC_AutoPtr<_Ty>& operator=(const CBC_AutoPtr<_Ty>& _Y) {
- if (this != &_Y) {
- if (_Ptr != _Y.get()) {
- if (_Owns) {
- delete _Ptr;
- }
- _Owns = _Y._Owns;
- } else if (_Y._Owns) {
- _Owns = TRUE;
- }
- _Ptr = _Y.release();
- }
- return (*this);
- }
- ~CBC_AutoPtr() {
- if (_Owns) {
- delete _Ptr;
- }
- }
- _Ty& operator*() const { return (*get()); }
- _Ty* operator->() const { return (get()); }
- _Ty* get() const { return (_Ptr); }
- _Ty* release() const {
- ((CBC_AutoPtr<_Ty>*)this)->_Owns = FALSE;
- return (_Ptr);
- }
- private:
- FX_BOOL _Owns;
- _Ty* _Ptr;
-};
#if (_FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_)
#include <limits>
#elif(_FX_OS_ == _FX_MACOSX_ || _FX_OS_ == _FX_LINUX_DESKTOP_ || \
« xfa/src/fxbarcode/qrcode/BC_QRDataBlock.h ('K') | « xfa/src/fxbarcode/qrcode/BC_QRGridSampler.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698