diff options
author | Tom Sepez <tsepez@chromium.org> | 2018-06-11 17:48:17 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-06-11 17:48:17 +0000 |
commit | e3b782fe20282fd3ccde0ca8a47d8e7fcd9b8dcc (patch) | |
tree | e467c45d15b40c5711eb990208660a57f47345ca /fxjs/cfxjs_engine.h | |
parent | b372dc6b20fca803aef86583551982fb9178011f (diff) | |
download | pdfium-e3b782fe20282fd3ccde0ca8a47d8e7fcd9b8dcc.tar.xz |
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 <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fxjs/cfxjs_engine.h')
-rw-r--r-- | fxjs/cfxjs_engine.h | 9 |
1 files changed, 8 insertions, 1 deletions
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<int>(m_ObjectDefnArray); + } + CFXJS_ObjDefinition* ObjDefinitionForID(int id) const; + int AssignIDForObjDefinition(std::unique_ptr<CFXJS_ObjDefinition> pDefn); + std::vector<std::unique_ptr<CFXJS_ObjDefinition>> m_ObjectDefnArray; + std::unique_ptr<V8TemplateMap> m_pDynamicObjsMap; #ifdef PDF_ENABLE_XFA std::unique_ptr<CFXJSE_RuntimeData> m_pFXJSERuntimeData; #endif // PDF_ENABLE_XFA - std::unique_ptr<V8TemplateMap> m_pDynamicObjsMap; protected: explicit FXJS_PerIsolateData(v8::Isolate* pIsolate); |