summaryrefslogtreecommitdiff
path: root/fpdfsdk/include/cpdfsdk_document.h
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-09-27 14:29:57 -0700
committerCommit bot <commit-bot@chromium.org>2016-09-27 14:29:57 -0700
commitf8074cefb2f8d947fa83d151bcbe080b485d6e6b (patch)
treefe97655234318181a58827666576010abb745b18 /fpdfsdk/include/cpdfsdk_document.h
parentec7a9455c15b2cebb75a6036c8636beb601e543a (diff)
downloadpdfium-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_document.h')
-rw-r--r--fpdfsdk/include/cpdfsdk_document.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/fpdfsdk/include/cpdfsdk_document.h b/fpdfsdk/include/cpdfsdk_document.h
index 5a83b74296..9fce00f684 100644
--- a/fpdfsdk/include/cpdfsdk_document.h
+++ b/fpdfsdk/include/cpdfsdk_document.h
@@ -12,12 +12,12 @@
#include "core/fpdfapi/fpdf_parser/include/cpdf_document.h"
#include "core/fxcrt/include/cfx_observable.h"
+#include "fpdfsdk/include/cpdfsdk_annot.h"
#include "fpdfsdk/include/fsdk_define.h"
#include "public/fpdf_formfill.h"
class CPDF_OCContext;
class CPDFSDK_Environment;
-class CPDFSDK_Annot;
class CPDFSDK_InterForm;
class CPDFSDK_PageView;
class IJS_Runtime;
@@ -68,7 +68,7 @@ class CPDFSDK_Document : public CFX_Observable<CPDFSDK_Document> {
IJS_Runtime* GetJsRuntime();
- FX_BOOL SetFocusAnnot(CPDFSDK_Annot* pAnnot, uint32_t nFlag = 0);
+ FX_BOOL SetFocusAnnot(CPDFSDK_Annot::ObservedPtr* pAnnot, uint32_t nFlag = 0);
FX_BOOL KillFocusAnnot(uint32_t nFlag = 0);
FX_BOOL ExtractPages(const std::vector<uint16_t>& arrExtraPages,
@@ -98,7 +98,7 @@ class CPDFSDK_Document : public CFX_Observable<CPDFSDK_Document> {
std::map<UnderlyingPageType*, CPDFSDK_PageView*> m_pageMap;
UnderlyingDocumentType* m_pDoc;
std::unique_ptr<CPDFSDK_InterForm> m_pInterForm;
- CPDFSDK_Annot* m_pFocusAnnot;
+ CPDFSDK_Annot::ObservedPtr m_pFocusAnnot;
CPDFSDK_Environment* m_pEnv;
std::unique_ptr<CPDF_OCContext> m_pOccontent;
FX_BOOL m_bChangeMask;