diff options
author | tsepez <tsepez@chromium.org> | 2016-08-15 16:44:55 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-08-15 16:44:55 -0700 |
commit | b4694249b336d1c0bea9222880b49dcf9284791d (patch) | |
tree | 681a503d12000b78296bcacf4fce046922335950 /fpdfsdk/javascript/cjs_runtime.h | |
parent | 19cdfe4d73370b21709aefd9dce06cf463239fa1 (diff) | |
download | pdfium-b4694249b336d1c0bea9222880b49dcf9284791d.tar.xz |
Push v8::Isolate into CFXJS_Engine classchromium/2831
Nearly all the "loose" functions in FXJS become methods on
the CFJXS_Engine.
This is the "missing link" wrt some layering violatons that
have been around forever. We can stop passing &m_ variables
from CJS_ down into FXJS Initialization as a result.
Review-Url: https://codereview.chromium.org/2245863002
Diffstat (limited to 'fpdfsdk/javascript/cjs_runtime.h')
-rw-r--r-- | fpdfsdk/javascript/cjs_runtime.h | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/fpdfsdk/javascript/cjs_runtime.h b/fpdfsdk/javascript/cjs_runtime.h index 16432d5394..33d2956ce3 100644 --- a/fpdfsdk/javascript/cjs_runtime.h +++ b/fpdfsdk/javascript/cjs_runtime.h @@ -33,6 +33,7 @@ class CJS_Runtime : public IJS_Runtime, public CFXJS_Engine { using FieldEvent = std::pair<CFX_WideString, JS_EVENT_T>; static CJS_Runtime* FromContext(const IJS_Context* cc); + static CJS_Runtime* CurrentRuntimeFromIsolate(v8::Isolate* pIsolate); explicit CJS_Runtime(CPDFDoc_Environment* pApp); ~CJS_Runtime() override; @@ -43,7 +44,8 @@ class CJS_Runtime : public IJS_Runtime, public CFXJS_Engine { IJS_Context* GetCurrentContext() override; void SetReaderDocument(CPDFSDK_Document* pReaderDoc) override; CPDFSDK_Document* GetReaderDocument() override; - int Execute(const CFX_WideString& script, CFX_WideString* info) override; + int ExecuteScript(const CFX_WideString& script, + CFX_WideString* info) override; CPDFDoc_Environment* GetReaderApp() const { return m_pApp; } @@ -55,12 +57,6 @@ class CJS_Runtime : public IJS_Runtime, public CFXJS_Engine { void EndBlock() { m_bBlocking = FALSE; } FX_BOOL IsBlocking() const { return m_bBlocking; } - v8::Isolate* GetIsolate() const { return m_isolate; } - v8::Local<v8::Context> NewJSContext(); - - void SetConstArray(const CFX_WideString& name, v8::Local<v8::Array> array); - v8::Local<v8::Array> GetConstArray(const CFX_WideString& name); - #ifdef PDF_ENABLE_XFA FX_BOOL GetValueByName(const CFX_ByteStringC& utf8Name, CFXJSE_Value* pValue) override; |