summaryrefslogtreecommitdiff
path: root/fpdfsdk/javascript/cjs_runtime.h
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-08-15 11:40:12 -0700
committerCommit bot <commit-bot@chromium.org>2016-08-15 11:40:12 -0700
commita4941914bb4411dc4e9053cb344e0349db388007 (patch)
tree5b5784812bddf80eb4a79ed2597f016f8b72d8ce /fpdfsdk/javascript/cjs_runtime.h
parent2ba53c176df1bc5bb963901e7cc42c6a60af24eb (diff)
downloadpdfium-a4941914bb4411dc4e9053cb344e0349db388007.tar.xz
Move some v8 objects from CJS back into FXJS
Create a new class to hold these, CFXJS_Engine (could have been called Runtime, but there are too many "Runtimes" already). In a subsequent patch, all the FXJS_*() functions that take an isolate as the first argument can become methods on the engine. CJS_ must still manage the isolates; this happens outside the engine. The IJS_Runtime abstraction moves up to fpdfsdk/javascript; it remains to allow for either a real JS library or a stubb one to be linked (for non-js builds). Review-Url: https://codereview.chromium.org/2241483004
Diffstat (limited to 'fpdfsdk/javascript/cjs_runtime.h')
-rw-r--r--fpdfsdk/javascript/cjs_runtime.h10
1 files changed, 3 insertions, 7 deletions
diff --git a/fpdfsdk/javascript/cjs_runtime.h b/fpdfsdk/javascript/cjs_runtime.h
index c43a34b720..16432d5394 100644
--- a/fpdfsdk/javascript/cjs_runtime.h
+++ b/fpdfsdk/javascript/cjs_runtime.h
@@ -20,7 +20,7 @@
class CJS_Context;
-class CJS_Runtime : public IJS_Runtime {
+class CJS_Runtime : public IJS_Runtime, public CFXJS_Engine {
public:
class Observer {
public:
@@ -77,13 +77,9 @@ class CJS_Runtime : public IJS_Runtime {
std::vector<std::unique_ptr<CJS_Context>> m_ContextArray;
CPDFDoc_Environment* const m_pApp;
CPDFSDK_Document* m_pDocument;
- FX_BOOL m_bBlocking;
- std::set<FieldEvent> m_FieldEventSet;
- v8::Isolate* m_isolate;
+ bool m_bBlocking;
bool m_isolateManaged;
- v8::Global<v8::Context> m_context;
- std::vector<v8::Global<v8::Object>*> m_StaticObjects;
- std::map<CFX_WideString, v8::Global<v8::Array>> m_ConstArrays;
+ std::set<FieldEvent> m_FieldEventSet;
std::set<Observer*> m_observers;
};