summaryrefslogtreecommitdiff
path: root/xfa/src/fwl
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-01-16 14:59:26 -0800
committerTom Sepez <tsepez@chromium.org>2015-01-16 14:59:26 -0800
commit96d1334cb605aab143d3135da4d4550920735e91 (patch)
tree0a4371ef00759ce63cbb1324ef018b0311bcf84d /xfa/src/fwl
parenta7f7a284393dbadeb1aaa861677570b61b9658ae (diff)
downloadpdfium-96d1334cb605aab143d3135da4d4550920735e91.tar.xz
Merge to XFA: PDFium embeddertests.
This consists of two origin/master CLs: Review URL: https://codereview.chromium.org/857483005 Review URL: https://codereview.chromium.org/827733006 It also fixes a couple of segv's in XFA when the library is initialized and destroyed multiple times in the same process. R=jam@chromium.org TBR=jam@chromium.org Review URL: https://codereview.chromium.org/856623004
Diffstat (limited to 'xfa/src/fwl')
-rw-r--r--xfa/src/fwl/src/core/fwl_appimp.cpp2
-rw-r--r--xfa/src/fwl/src/core/fwl_noteimp.cpp19
-rw-r--r--xfa/src/fwl/src/core/include/fwl_noteimp.h9
3 files changed, 23 insertions, 7 deletions
diff --git a/xfa/src/fwl/src/core/fwl_appimp.cpp b/xfa/src/fwl/src/core/fwl_appimp.cpp
index 70e46e6a41..e70d3f6a09 100644
--- a/xfa/src/fwl/src/core/fwl_appimp.cpp
+++ b/xfa/src/fwl/src/core/fwl_appimp.cpp
@@ -28,7 +28,7 @@ CFWL_AppImp::CFWL_AppImp(IFWL_AdapterNative *pAdapter)
}
CFWL_AppImp::~CFWL_AppImp()
{
- delete CFWL_ToolTipContainer::getInstance();
+ CFWL_ToolTipContainer::DeleteInstance();
if (m_bFuelAdapter) {
FWL_ReleaseFuelAdapterNative(m_pAdapterNative);
m_pAdapterNative = NULL;
diff --git a/xfa/src/fwl/src/core/fwl_noteimp.cpp b/xfa/src/fwl/src/core/fwl_noteimp.cpp
index 40f0c1137d..417020ac0f 100644
--- a/xfa/src/fwl/src/core/fwl_noteimp.cpp
+++ b/xfa/src/fwl/src/core/fwl_noteimp.cpp
@@ -938,6 +938,9 @@ FX_BOOL CFWL_EventTarget::IsFilterEvent(CFWL_Event *pEvent, FX_DWORD dwFilter)
}
return bRet;
}
+
+CFWL_ToolTipContainer* CFWL_ToolTipContainer::s_pInstance = NULL;
+
CFWL_ToolTipContainer::CFWL_ToolTipContainer()
: pCurTarget(NULL)
, m_pToolTipImp(NULL)
@@ -959,13 +962,21 @@ CFWL_ToolTipContainer::~CFWL_ToolTipContainer()
m_ToolTipDp = NULL;
}
}
+// static
CFWL_ToolTipContainer* CFWL_ToolTipContainer::getInstance()
{
- static CFWL_ToolTipContainer * _toolTipContainer = NULL;
- if (!_toolTipContainer) {
- _toolTipContainer = FX_NEW CFWL_ToolTipContainer;
+ if (!s_pInstance) {
+ s_pInstance = FX_NEW CFWL_ToolTipContainer;
+ }
+ return s_pInstance;
+}
+// static
+void CFWL_ToolTipContainer::DeleteInstance()
+{
+ if (s_pInstance) {
+ delete s_pInstance;
+ s_pInstance = NULL;
}
- return _toolTipContainer;
}
FX_ERR CFWL_ToolTipContainer::AddToolTipTarget(IFWL_ToolTipTarget *pTarget)
{
diff --git a/xfa/src/fwl/src/core/include/fwl_noteimp.h b/xfa/src/fwl/src/core/include/fwl_noteimp.h
index 1e7239289b..aeed0b3955 100644
--- a/xfa/src/fwl/src/core/include/fwl_noteimp.h
+++ b/xfa/src/fwl/src/core/include/fwl_noteimp.h
@@ -127,8 +127,8 @@ protected:
class CFWL_ToolTipContainer: public CFX_Object
{
public:
- virtual ~CFWL_ToolTipContainer();
static CFWL_ToolTipContainer* getInstance();
+ static void DeleteInstance();
FX_ERR AddToolTipTarget(IFWL_ToolTipTarget *pTarget);
FX_ERR RemoveToolTipTarget(IFWL_ToolTipTarget *pTarget);
@@ -140,13 +140,18 @@ public:
FX_BOOL ProcessLeave(CFWL_EvtMouse *pEvt);
FX_ERR SetToolTipInitialDelay(FX_INT32 iDelayTime);
- FX_ERR SetToolTipAutoPopDelay(FX_INT32 iDelayTime);
+ FX_ERR SetToolTipAutoPopDelay(FX_INT32 iDelayTime);
+
protected:
CFWL_ToolTipContainer();
+ virtual ~CFWL_ToolTipContainer();
IFWL_ToolTipTarget *pCurTarget;
CFWL_ToolTipImp *m_pToolTipImp;
CFWL_CoreToopTipDP *m_ToolTipDp;
CFX_PtrArray m_arrWidget;
+
+private:
+ static CFWL_ToolTipContainer* s_pInstance;
};
#endif