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

Unified Diff: core/fxcrt/include/fx_basic.h

Issue 2045083003: Remove implicit CFX_CountedRef::operator T*() (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Fix mac build. Created 4 years, 6 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
« no previous file with comments | « core/fpdfdoc/doc_ocg.cpp ('k') | core/fxge/agg/fx_agg_driver.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fxcrt/include/fx_basic.h
diff --git a/core/fxcrt/include/fx_basic.h b/core/fxcrt/include/fx_basic.h
index 8e39f5577aba1186aa781600c750967f0c58c74c..bc05a3479dacd5038ef4d780e3b011413089eca2 100644
--- a/core/fxcrt/include/fx_basic.h
+++ b/core/fxcrt/include/fx_basic.h
@@ -648,27 +648,24 @@ class CFX_BitStream {
const uint8_t* m_pData;
};
+
template <class ObjClass>
class CFX_CountRef {
public:
- typedef CFX_CountRef<ObjClass> Ref;
+ using Ref = CFX_CountRef<ObjClass>;
class CountedObj : public ObjClass {
public:
CountedObj() {}
-
CountedObj(const CountedObj& src) : ObjClass(src) {}
int m_RefCount;
};
- CFX_CountRef() { m_pObject = nullptr; }
-
- CFX_CountRef(const Ref& ref) {
- m_pObject = ref.m_pObject;
- if (m_pObject) {
+ CFX_CountRef() : m_pObject(nullptr) {}
+ CFX_CountRef(const Ref& ref) : m_pObject(ref.m_pObject) {
+ if (m_pObject)
m_pObject->m_RefCount++;
- }
}
~CFX_CountRef() { SetNull(); }
@@ -687,14 +684,10 @@ class CFX_CountRef {
m_pObject = ref.m_pObject;
}
- const ObjClass* GetObject() const { return m_pObject; }
-
- operator const ObjClass*() const { return m_pObject; }
-
- FX_BOOL IsNull() const { return !m_pObject; }
-
- FX_BOOL NotNull() const { return !IsNull(); }
+ bool IsNull() const { return !m_pObject; }
+ bool NotNull() const { return !IsNull(); }
dsinclair 2016/06/08 18:45:54 Can we have a followup to remove this? Seems just
+ const ObjClass* GetObject() const { return m_pObject; }
ObjClass* GetModify() {
if (!m_pObject) {
m_pObject = new CountedObj;
@@ -724,6 +717,7 @@ class CFX_CountRef {
protected:
CountedObj* m_pObject;
};
+
class IFX_Pause {
public:
virtual ~IFX_Pause() {}
« no previous file with comments | « core/fpdfdoc/doc_ocg.cpp ('k') | core/fxge/agg/fx_agg_driver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698