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_xfawidgethandler.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_xfawidgethandler.h')
-rw-r--r-- | fpdfsdk/include/cpdfsdk_xfawidgethandler.h | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/fpdfsdk/include/cpdfsdk_xfawidgethandler.h b/fpdfsdk/include/cpdfsdk_xfawidgethandler.h index c18a36f8b6..2bf977951c 100644 --- a/fpdfsdk/include/cpdfsdk_xfawidgethandler.h +++ b/fpdfsdk/include/cpdfsdk_xfawidgethandler.h @@ -46,42 +46,42 @@ class CPDFSDK_XFAWidgetHandler : public IPDFSDK_AnnotHandler { void OnDelete(CPDFSDK_Annot* pAnnot) override; void OnRelease(CPDFSDK_Annot* pAnnot) override; void OnMouseEnter(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot, + CPDFSDK_Annot::ObservedPtr* pAnnot, uint32_t nFlag) override; void OnMouseExit(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot, + CPDFSDK_Annot::ObservedPtr* pAnnot, uint32_t nFlag) override; FX_BOOL OnLButtonDown(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot, + CPDFSDK_Annot::ObservedPtr* pAnnot, uint32_t nFlags, const CFX_FloatPoint& point) override; FX_BOOL OnLButtonUp(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot, + CPDFSDK_Annot::ObservedPtr* pAnnot, uint32_t nFlags, const CFX_FloatPoint& point) override; FX_BOOL OnLButtonDblClk(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot, + CPDFSDK_Annot::ObservedPtr* pAnnot, uint32_t nFlags, const CFX_FloatPoint& point) override; FX_BOOL OnMouseMove(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot, + CPDFSDK_Annot::ObservedPtr* pAnnot, uint32_t nFlags, const CFX_FloatPoint& point) override; FX_BOOL OnMouseWheel(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot, + CPDFSDK_Annot::ObservedPtr* pAnnot, uint32_t nFlags, short zDelta, const CFX_FloatPoint& point) override; FX_BOOL OnRButtonDown(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot, + CPDFSDK_Annot::ObservedPtr* pAnnot, uint32_t nFlags, const CFX_FloatPoint& point) override; FX_BOOL OnRButtonUp(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot, + CPDFSDK_Annot::ObservedPtr* pAnnot, uint32_t nFlags, const CFX_FloatPoint& point) override; FX_BOOL OnRButtonDblClk(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot, + CPDFSDK_Annot::ObservedPtr* pAnnot, uint32_t nFlags, const CFX_FloatPoint& point) override; FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, @@ -91,10 +91,12 @@ class CPDFSDK_XFAWidgetHandler : public IPDFSDK_AnnotHandler { FX_BOOL OnKeyUp(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag) override; void OnDeSelected(CPDFSDK_Annot* pAnnot) override; void OnSelected(CPDFSDK_Annot* pAnnot) override; - FX_BOOL OnSetFocus(CPDFSDK_Annot* pAnnot, uint32_t nFlag) override; - FX_BOOL OnKillFocus(CPDFSDK_Annot* pAnnot, uint32_t nFlag) override; - FX_BOOL OnXFAChangedFocus(CPDFSDK_Annot* pOldAnnot, - CPDFSDK_Annot* pNewAnnot) override; + FX_BOOL OnSetFocus(CPDFSDK_Annot::ObservedPtr* pAnnot, + uint32_t nFlag) override; + FX_BOOL OnKillFocus(CPDFSDK_Annot::ObservedPtr* pAnnot, + uint32_t nFlag) override; + FX_BOOL OnXFAChangedFocus(CPDFSDK_Annot::ObservedPtr* pOldAnnot, + CPDFSDK_Annot::ObservedPtr* pNewAnnot) override; private: CXFA_FFWidgetHandler* GetXFAWidgetHandler(CPDFSDK_Annot* pAnnot); |