From 4741b291f462c0c4a5de4abf1653c3b3c87b613a Mon Sep 17 00:00:00 2001 From: tsepez Date: Tue, 3 Jan 2017 15:58:33 -0800 Subject: Add CFX_RetainPtr Leak() and Unleak() methods Required to pass pointers across C-APIs. Need this to clean up CPDFXFA_Page and retain ptrs. Review-Url: https://codereview.chromium.org/2583093003 --- core/fxcrt/cfx_retain_ptr.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'core/fxcrt/cfx_retain_ptr.h') diff --git a/core/fxcrt/cfx_retain_ptr.h b/core/fxcrt/cfx_retain_ptr.h index bff1b9691c..1b137d4974 100644 --- a/core/fxcrt/cfx_retain_ptr.h +++ b/core/fxcrt/cfx_retain_ptr.h @@ -37,6 +37,10 @@ class CFX_RetainPtr { T* Get() const { return m_pObj.get(); } void Swap(CFX_RetainPtr& that) { m_pObj.swap(that.m_pObj); } + // TODO(tsepez): temporary scaffolding, to be removed. + T* Leak() { return m_pObj.release(); } + void Unleak(T* ptr) { m_pObj.reset(ptr); } + CFX_RetainPtr& operator=(const CFX_RetainPtr& that) { if (*this != that) Reset(that.Get()); -- cgit v1.2.3