diff options
author | tsepez <tsepez@chromium.org> | 2016-08-29 14:42:36 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-08-29 14:42:36 -0700 |
commit | d24c3a60d0e6e5badef57d3baf55e5c3b6d4882e (patch) | |
tree | 56abe4fe5e26d4aa18b1921d1f8208065aae0bbd /core/fxcrt/include | |
parent | 596014357f7cd9ee3245ba8ed52cbc5761151727 (diff) | |
download | pdfium-d24c3a60d0e6e5badef57d3baf55e5c3b6d4882e.tar.xz |
Revert "Add -> operators to CFX_CountRef."
This reverts commit c10c23a2b1999b1cb0354fd4db9837dc63a3d833.
TBR=dsinclair@chromium.org
Review-Url: https://codereview.chromium.org/2285283003
Diffstat (limited to 'core/fxcrt/include')
-rw-r--r-- | core/fxcrt/include/cfx_count_ref.h | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/core/fxcrt/include/cfx_count_ref.h b/core/fxcrt/include/cfx_count_ref.h index 0837894c66..817ce95add 100644 --- a/core/fxcrt/include/cfx_count_ref.h +++ b/core/fxcrt/include/cfx_count_ref.h @@ -29,16 +29,17 @@ class CFX_CountRef { return *this; } - void Clear() { m_pObject.Reset(); } + void SetNull() { m_pObject.Reset(); } ObjClass* GetObject() { return m_pObject.Get(); } const ObjClass* GetObject() const { return m_pObject.Get(); } template <typename... Args> - void MakePrivateCopy(Args... params) { + ObjClass* GetPrivateCopy(Args... params) { if (!m_pObject) - m_pObject.Reset(new CountedObj(params...)); - else if (!m_pObject->HasOneRef()) + return New(params...); + if (!m_pObject->HasOneRef()) m_pObject.Reset(new CountedObj(*m_pObject)); + return m_pObject.Get(); } bool operator==(const CFX_CountRef& that) const { @@ -46,8 +47,6 @@ class CFX_CountRef { } bool operator!=(const CFX_CountRef& that) const { return !(*this == that); } operator bool() const { return m_pObject; } - ObjClass& operator*() const { return *m_pObject.Get(); } - ObjClass* operator->() const { return m_pObject.Get(); } private: class CountedObj : public ObjClass { |