diff options
author | tsepez <tsepez@chromium.org> | 2016-09-27 14:29:57 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-09-27 14:29:57 -0700 |
commit | f8074cefb2f8d947fa83d151bcbe080b485d6e6b (patch) | |
tree | fe97655234318181a58827666576010abb745b18 /fpdfsdk/include/cpdfsdk_annothandlermgr.h | |
parent | ec7a9455c15b2cebb75a6036c8636beb601e543a (diff) | |
download | pdfium-f8074cefb2f8d947fa83d151bcbe080b485d6e6b.tar.xz |
Watch destruction of widgets around OnAAction() method.
We implemented the CFX_Observable mechanism for detecting
stale objects some time ago; now just use it in more places.
Change method signatures to required an ObservedPtr to
indicate that the callers are aware that the value may be
destroyed out from underneath them.
BUG=649659
Review-Url: https://codereview.chromium.org/2368403002
Diffstat (limited to 'fpdfsdk/include/cpdfsdk_annothandlermgr.h')
-rw-r--r-- | fpdfsdk/include/cpdfsdk_annothandlermgr.h | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/fpdfsdk/include/cpdfsdk_annothandlermgr.h b/fpdfsdk/include/cpdfsdk_annothandlermgr.h index 9e0035cc4c..d66914aafb 100644 --- a/fpdfsdk/include/cpdfsdk_annothandlermgr.h +++ b/fpdfsdk/include/cpdfsdk_annothandlermgr.h @@ -13,11 +13,11 @@ #include "core/fpdfdoc/include/cpdf_annot.h" #include "core/fxcrt/include/fx_basic.h" #include "core/fxcrt/include/fx_coordinates.h" +#include "fpdfsdk/include/cpdfsdk_annot.h" class CFX_Matrix; class CFX_RenderDevice; class CPDFSDK_Environment; -class CPDFSDK_Annot; class CPDFSDK_BAAnnotHandler; class CPDFSDK_WidgetHandler; class CPDFSDK_PageView; @@ -50,50 +50,50 @@ class CPDFSDK_AnnotHandlerMgr { bool bDrawAnnots); void Annot_OnMouseEnter(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot, + CPDFSDK_Annot::ObservedPtr* pAnnot, uint32_t nFlags); void Annot_OnMouseExit(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot, + CPDFSDK_Annot::ObservedPtr* pAnnot, uint32_t nFlags); FX_BOOL Annot_OnLButtonDown(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot, + CPDFSDK_Annot::ObservedPtr* pAnnot, uint32_t nFlags, const CFX_FloatPoint& point); FX_BOOL Annot_OnLButtonUp(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot, + CPDFSDK_Annot::ObservedPtr* pAnnot, uint32_t nFlags, const CFX_FloatPoint& point); FX_BOOL Annot_OnLButtonDblClk(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot, + CPDFSDK_Annot::ObservedPtr* pAnnot, uint32_t nFlags, const CFX_FloatPoint& point); FX_BOOL Annot_OnMouseMove(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot, + CPDFSDK_Annot::ObservedPtr* pAnnot, uint32_t nFlags, const CFX_FloatPoint& point); FX_BOOL Annot_OnMouseWheel(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot, + CPDFSDK_Annot::ObservedPtr* pAnnot, uint32_t nFlags, short zDelta, const CFX_FloatPoint& point); FX_BOOL Annot_OnRButtonDown(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot, + CPDFSDK_Annot::ObservedPtr* pAnnot, uint32_t nFlags, const CFX_FloatPoint& point); FX_BOOL Annot_OnRButtonUp(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot, + CPDFSDK_Annot::ObservedPtr* pAnnot, uint32_t nFlags, const CFX_FloatPoint& point); FX_BOOL Annot_OnChar(CPDFSDK_Annot* pAnnot, uint32_t nChar, uint32_t nFlags); FX_BOOL Annot_OnKeyDown(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag); FX_BOOL Annot_OnKeyUp(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag); - FX_BOOL Annot_OnSetFocus(CPDFSDK_Annot* pAnnot, uint32_t nFlag); - FX_BOOL Annot_OnKillFocus(CPDFSDK_Annot* pAnnot, uint32_t nFlag); + FX_BOOL Annot_OnSetFocus(CPDFSDK_Annot::ObservedPtr* pAnnot, uint32_t nFlag); + FX_BOOL Annot_OnKillFocus(CPDFSDK_Annot::ObservedPtr* pAnnot, uint32_t nFlag); #ifdef PDF_ENABLE_XFA - FX_BOOL Annot_OnChangeFocus(CPDFSDK_Annot* pSetAnnot, - CPDFSDK_Annot* pKillAnnot); + FX_BOOL Annot_OnChangeFocus(CPDFSDK_Annot::ObservedPtr* pSetAnnot, + CPDFSDK_Annot::ObservedPtr* pKillAnnot); #endif // PDF_ENABLE_XFA CFX_FloatRect Annot_OnGetViewBBox(CPDFSDK_PageView* pPageView, |