From 602aebc11a615971800d38f8d427a4e4f95c1134 Mon Sep 17 00:00:00 2001 From: tsepez Date: Tue, 29 Mar 2016 15:04:21 -0700 Subject: Add a Retained Pointer smart class. It's going to be hard to fix some XFA object leaks without this. Put this in fxcrt/ as we should be able to make the FX strings take advantage of this. BUG=pdfium:55 Review URL: https://codereview.chromium.org/1805683002 --- core/fxcrt/include/fx_basic.h | 26 -------------------------- 1 file changed, 26 deletions(-) (limited to 'core/fxcrt/include/fx_basic.h') diff --git a/core/fxcrt/include/fx_basic.h b/core/fxcrt/include/fx_basic.h index 8a7afda137..feeb6e756d 100644 --- a/core/fxcrt/include/fx_basic.h +++ b/core/fxcrt/include/fx_basic.h @@ -15,32 +15,6 @@ #include "core/fxcrt/include/fx_string.h" #include "core/fxcrt/include/fx_system.h" -// The FX_ArraySize(arr) macro returns the # of elements in an array arr. -// The expression is a compile-time constant, and therefore can be -// used in defining new arrays, for example. If you use FX_ArraySize on -// a pointer by mistake, you will get a compile-time error. -// -// One caveat is that FX_ArraySize() doesn't accept any array of an -// anonymous type or a type defined inside a function. -#define FX_ArraySize(array) (sizeof(ArraySizeHelper(array))) - -// This template function declaration is used in defining FX_ArraySize. -// Note that the function doesn't need an implementation, as we only -// use its type. -template -char(&ArraySizeHelper(T(&array)[N]))[N]; - -// Used with std::unique_ptr to FX_Free raw memory. -struct FxFreeDeleter { - inline void operator()(void* ptr) const { FX_Free(ptr); } -}; - -// Used with std::unique_ptr to Release() objects that can't be deleted. -template -struct ReleaseDeleter { - inline void operator()(T* ptr) const { ptr->Release(); } -}; - class CFX_BinaryBuf { public: CFX_BinaryBuf(); -- cgit v1.2.3