diff options
author | tsepez <tsepez@chromium.org> | 2016-05-23 17:19:20 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-05-23 17:19:20 -0700 |
commit | a2d699f1462050833f959ebcf24853c2a6a10f72 (patch) | |
tree | 35cc25303ebc2bd68d36255e6db69a08f043dc66 /xfa/fxfa/app | |
parent | db1a24e86d40977fb6d8aa8fa57dadee4c2f1be1 (diff) | |
download | pdfium-a2d699f1462050833f959ebcf24853c2a6a10f72.tar.xz |
Rename IFX_Unknown to IFX_Retainable.
Rename addRef() method to Retain() to match Release().
This CL does not convert to CFX_RetainPtrs, which will happen
in a follow-on.
Review-Url: https://codereview.chromium.org/2005933002
Diffstat (limited to 'xfa/fxfa/app')
-rw-r--r-- | xfa/fxfa/app/xfa_textlayout.cpp | 8 | ||||
-rw-r--r-- | xfa/fxfa/app/xfa_textlayout.h | 14 |
2 files changed, 12 insertions, 10 deletions
diff --git a/xfa/fxfa/app/xfa_textlayout.cpp b/xfa/fxfa/app/xfa_textlayout.cpp index 5dac289404..a382d83bd9 100644 --- a/xfa/fxfa/app/xfa_textlayout.cpp +++ b/xfa/fxfa/app/xfa_textlayout.cpp @@ -193,7 +193,7 @@ IFDE_CSSComputedStyle* CXFA_TextParser::ComputeStyle( if (!pContext) return nullptr; pContext->m_pParentStyle = pParentStyle; - pParentStyle->AddRef(); + pParentStyle->Retain(); CXFA_CSSTagProvider tagProvider; ParseTagInfo(pXMLNode, tagProvider); if (tagProvider.m_bContent) @@ -1444,7 +1444,7 @@ FX_BOOL CXFA_TextLayout::LoadRichText(CFDE_XMLNode* pXMLNode, if (wsText.GetLength() > 0) { if (m_pLoader == NULL || m_pLoader->m_iChar == 0) { if (pLinkData) { - pLinkData->AddRef(); + pLinkData->Retain(); } CXFA_TextUserData* pUserData = FXTARGET_NewWith(m_pAllocator.get()) CXFA_TextUserData(m_pAllocator.get(), @@ -1722,7 +1722,7 @@ void CXFA_TextLayout::AppendTextLine(uint32_t dwStatus, } fLineStep = std::max(fLineStep, fLineHeight); if (pUserData && pUserData->m_pLinkData) { - pUserData->m_pLinkData->AddRef(); + pUserData->m_pLinkData->Retain(); pTP->pLinkData = pUserData->m_pLinkData; } else { pTP->pLinkData = NULL; @@ -1768,7 +1768,7 @@ void CXFA_TextLayout::AppendTextLine(uint32_t dwStatus, } } if (pStyle) { - pStyle->AddRef(); + pStyle->Retain(); } m_pBreak->ClearBreakPieces(); if (dwStatus == FX_RTFBREAK_ParagraphBreak) { diff --git a/xfa/fxfa/app/xfa_textlayout.h b/xfa/fxfa/app/xfa_textlayout.h index 0b3ec94604..30399a6217 100644 --- a/xfa/fxfa/app/xfa_textlayout.h +++ b/xfa/fxfa/app/xfa_textlayout.h @@ -171,14 +171,15 @@ class CXFA_LoaderContext { CFX_FloatArray m_BlocksHeight; }; -class CXFA_LinkUserData : public IFX_Unknown, public CFX_Target { +class CXFA_LinkUserData : public IFX_Retainable, public CFX_Target { public: CXFA_LinkUserData(IFX_MemoryAllocator* pAllocator, FX_WCHAR* pszText) : m_pAllocator(pAllocator), m_dwRefCount(1), m_wsURLContent(pszText) {} ~CXFA_LinkUserData() override {} - uint32_t AddRef() override { return ++m_dwRefCount; } + // IFX_Retainable: + uint32_t Retain() override { return ++m_dwRefCount; } uint32_t Release() override { uint32_t dwRefCount = --m_dwRefCount; if (dwRefCount <= 0) @@ -194,7 +195,7 @@ class CXFA_LinkUserData : public IFX_Unknown, public CFX_Target { CFX_WideString m_wsURLContent; }; -class CXFA_TextUserData : public IFX_Unknown, public CFX_Target { +class CXFA_TextUserData : public IFX_Retainable, public CFX_Target { public: CXFA_TextUserData(IFX_MemoryAllocator* pAllocator, IFDE_CSSComputedStyle* pStyle) @@ -204,7 +205,7 @@ class CXFA_TextUserData : public IFX_Unknown, public CFX_Target { m_dwRefCount(0) { ASSERT(m_pAllocator); if (m_pStyle) - m_pStyle->AddRef(); + m_pStyle->Retain(); } CXFA_TextUserData(IFX_MemoryAllocator* pAllocator, IFDE_CSSComputedStyle* pStyle, @@ -215,7 +216,7 @@ class CXFA_TextUserData : public IFX_Unknown, public CFX_Target { m_dwRefCount(0) { ASSERT(m_pAllocator); if (m_pStyle) - m_pStyle->AddRef(); + m_pStyle->Retain(); } ~CXFA_TextUserData() override { if (m_pStyle) @@ -224,7 +225,8 @@ class CXFA_TextUserData : public IFX_Unknown, public CFX_Target { m_pLinkData->Release(); } - uint32_t AddRef() override { return ++m_dwRefCount; } + // IFX_Retainable: + uint32_t Retain() override { return ++m_dwRefCount; } uint32_t Release() override { uint32_t dwRefCount = --m_dwRefCount; if (dwRefCount == 0) |