summaryrefslogtreecommitdiff
path: root/fpdfsdk/javascript/Annot.h
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2016-09-13 14:52:55 -0400
committerDan Sinclair <dsinclair@chromium.org>2016-09-13 14:52:55 -0400
commit0703fa810bc79a335ddfdab3e7661159caf88e2d (patch)
treeb5793cf84419aa426acf3b28cac6af9ef9fe55f8 /fpdfsdk/javascript/Annot.h
parentccf7734cad06cb9383d55190d6cd6aa6ccc91ab2 (diff)
downloadpdfium-chromium/2840.tar.xz
[Merge to 54] Add observer for BAAnnots from Javascriptchromium/2840
This Cl moves the observer code from the CPDFSDK_Widget up into the CPDFSDK_Annot base class and then adds a second observer for CPDFSDK_BAAnnot objects. This allows us to attach an observer to the Annot javascript class which will update its internal pointer to the BAAnnot if the BAAnnot is destroyed by the CPDFSDK_PageView being destroyed. BUG=chromium:642307 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/2333383002 . Review-Url: https://codereview.chromium.org/2306663002
Diffstat (limited to 'fpdfsdk/javascript/Annot.h')
-rw-r--r--fpdfsdk/javascript/Annot.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/fpdfsdk/javascript/Annot.h b/fpdfsdk/javascript/Annot.h
index b3ea292aed..be850350ae 100644
--- a/fpdfsdk/javascript/Annot.h
+++ b/fpdfsdk/javascript/Annot.h
@@ -7,6 +7,8 @@
#ifndef FPDFSDK_JAVASCRIPT_ANNOT_H_
#define FPDFSDK_JAVASCRIPT_ANNOT_H_
+#include <memory>
+
#include "fpdfsdk/include/cpdfsdk_baannot.h"
#include "fpdfsdk/javascript/JS_Define.h"
@@ -22,7 +24,8 @@ class Annot : public CJS_EmbedObj {
void SetSDKAnnot(CPDFSDK_BAAnnot* annot);
private:
- CPDFSDK_BAAnnot* m_BAAnnot = nullptr;
+ CPDFSDK_Annot* m_pAnnot = nullptr;
+ std::unique_ptr<CPDFSDK_Annot::Observer> m_pObserver;
};
class CJS_Annot : public CJS_Object {