From b1a3044cdcd99ab4c88927e8b840c0c712ae54e3 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Mon, 6 Nov 2017 14:53:21 +0000 Subject: Make XFA_MAPMODULESDATA a unique_ptr Change-Id: Icd72ee8d098fa0140119519f7079745bd5280a84 Reviewed-on: https://pdfium-review.googlesource.com/17592 Commit-Queue: dsinclair Reviewed-by: Tom Sepez --- fxjs/cjx_node.h | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) (limited to 'fxjs/cjx_node.h') diff --git a/fxjs/cjx_node.h b/fxjs/cjx_node.h index 80ee6ae4b2..a8b579c399 100644 --- a/fxjs/cjx_node.h +++ b/fxjs/cjx_node.h @@ -7,7 +7,7 @@ #ifndef FXJS_CJX_NODE_H_ #define FXJS_CJX_NODE_H_ -#include +#include #include "core/fxcrt/unowned_ptr.h" #include "fxjs/cjx_object.h" @@ -21,20 +21,6 @@ struct XFA_MAPDATABLOCKCALLBACKINFO { PD_CALLBACK_DUPLICATEDATA pCopy; }; -struct XFA_MAPDATABLOCK { - uint8_t* GetData() const { return (uint8_t*)this + sizeof(XFA_MAPDATABLOCK); } - XFA_MAPDATABLOCKCALLBACKINFO* pCallbackInfo; - int32_t iBytes; -}; - -struct XFA_MAPMODULEDATA { - XFA_MAPMODULEDATA(); - ~XFA_MAPMODULEDATA(); - - std::map m_ValueMap; - std::map m_BufferMap; -}; - enum XFA_SOM_MESSAGETYPE { XFA_SOM_ValidationMessage, XFA_SOM_FormatMessage, @@ -44,6 +30,8 @@ enum XFA_SOM_MESSAGETYPE { class CFXJSE_Arguments; class CXFA_Node; +struct XFA_MAPMODULEDATA; + class CJX_Node : public CJX_Object { public: explicit CJX_Node(CXFA_Node* node); @@ -123,7 +111,7 @@ class CJX_Node : public CJX_Object { bool TryNamespace(WideString& wsNamespace); - void MergeAllData(void* pDstModule); + void MergeAllData(CXFA_Node* pDstModule); void ThrowMissingPropertyException(const WideString& obj, const WideString& prop) const; @@ -453,7 +441,7 @@ class CJX_Node : public CJX_Object { int32_t execSingleEventByName(const WideStringView& wsEventName, XFA_Element eType); - XFA_MAPMODULEDATA* map_module_data_; + std::unique_ptr map_module_data_; }; #endif // FXJS_CJX_NODE_H_ -- cgit v1.2.3