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

Unified Diff: core/fxcrt/cfx_retain_ptr.h

Issue 2583093003: Add CFX_RetainPtr Leak() and Unleak() methods (Closed)
Patch Set: Reduce scope of change Created 4 years 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
« no previous file with comments | « no previous file | core/fxcrt/cfx_retain_ptr_unittest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fxcrt/cfx_retain_ptr.h
diff --git a/core/fxcrt/cfx_retain_ptr.h b/core/fxcrt/cfx_retain_ptr.h
index bff1b9691cd2d15913ee318df3310366e87efafe..1b137d4974fb71317ad05e0e750f5b11d4f53a40 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); }
Wei Li 2016/12/28 19:35:04 I don't quite understand the needs for these funct
+
CFX_RetainPtr& operator=(const CFX_RetainPtr& that) {
if (*this != that)
Reset(that.Get());
« no previous file with comments | « no previous file | core/fxcrt/cfx_retain_ptr_unittest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698