From e3b782fe20282fd3ccde0ca8a47d8e7fcd9b8dcc Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Mon, 11 Jun 2018 17:48:17 +0000 Subject: Move some FXJS methods onto the per-isolate object. This more clearly shows how information is flowing out of V8 and into our C++ callbacks. Change-Id: I5c37d2c28c166443eb9983076fbb0e944bebbf47 Reviewed-on: https://pdfium-review.googlesource.com/34790 Commit-Queue: Tom Sepez Reviewed-by: dsinclair --- fxjs/cfxjs_engine.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'fxjs/cfxjs_engine.h') diff --git a/fxjs/cfxjs_engine.h b/fxjs/cfxjs_engine.h index a5f94767c5..a940f3fc46 100644 --- a/fxjs/cfxjs_engine.h +++ b/fxjs/cfxjs_engine.h @@ -22,6 +22,7 @@ #include "core/fxcrt/fx_string.h" #include "fxjs/cfx_v8.h" #include "fxjs/ijs_runtime.h" +#include "third_party/base/stl_util.h" #include "v8/include/v8-util.h" #include "v8/include/v8.h" @@ -51,11 +52,17 @@ class FXJS_PerIsolateData { static void SetUp(v8::Isolate* pIsolate); static FXJS_PerIsolateData* Get(v8::Isolate* pIsolate); + int MaxObjDefinitionID() const { + return pdfium::CollectionSize(m_ObjectDefnArray); + } + CFXJS_ObjDefinition* ObjDefinitionForID(int id) const; + int AssignIDForObjDefinition(std::unique_ptr pDefn); + std::vector> m_ObjectDefnArray; + std::unique_ptr m_pDynamicObjsMap; #ifdef PDF_ENABLE_XFA std::unique_ptr m_pFXJSERuntimeData; #endif // PDF_ENABLE_XFA - std::unique_ptr m_pDynamicObjsMap; protected: explicit FXJS_PerIsolateData(v8::Isolate* pIsolate); -- cgit v1.2.3