summaryrefslogtreecommitdiff
path: root/fpdfsdk/include/javascript/JS_Runtime.h
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/include/javascript/JS_Runtime.h')
-rw-r--r--fpdfsdk/include/javascript/JS_Runtime.h86
1 files changed, 44 insertions, 42 deletions
diff --git a/fpdfsdk/include/javascript/JS_Runtime.h b/fpdfsdk/include/javascript/JS_Runtime.h
index 20d7d63eff..1fb0348263 100644
--- a/fpdfsdk/include/javascript/JS_Runtime.h
+++ b/fpdfsdk/include/javascript/JS_Runtime.h
@@ -16,63 +16,65 @@
class CJS_Context;
class CJS_ArrayBufferAllocator : public v8::ArrayBuffer::Allocator {
- void* Allocate(size_t length) override;
- void* AllocateUninitialized(size_t length) override;
- void Free(void* data, size_t length) override;
+ void* Allocate(size_t length) override;
+ void* AllocateUninitialized(size_t length) override;
+ void Free(void* data, size_t length) override;
};
-class CJS_FieldEvent
-{
-public:
- CFX_WideString sTargetName;
- JS_EVENT_T eEventType;
- CJS_FieldEvent* pNext;
+class CJS_FieldEvent {
+ public:
+ CFX_WideString sTargetName;
+ JS_EVENT_T eEventType;
+ CJS_FieldEvent* pNext;
};
-class CJS_Runtime : public IFXJS_Runtime
-{
-public:
- CJS_Runtime(CPDFDoc_Environment * pApp);
- virtual ~CJS_Runtime();
+class CJS_Runtime : public IFXJS_Runtime {
+ public:
+ CJS_Runtime(CPDFDoc_Environment* pApp);
+ virtual ~CJS_Runtime();
- virtual IFXJS_Context * NewContext();
- virtual void ReleaseContext(IFXJS_Context * pContext);
- virtual IFXJS_Context* GetCurrentContext();
+ virtual IFXJS_Context* NewContext();
+ virtual void ReleaseContext(IFXJS_Context* pContext);
+ virtual IFXJS_Context* GetCurrentContext();
- virtual void SetReaderDocument(CPDFSDK_Document *pReaderDoc);
- virtual CPDFSDK_Document * GetReaderDocument(){return m_pDocument;}
+ virtual void SetReaderDocument(CPDFSDK_Document* pReaderDoc);
+ virtual CPDFSDK_Document* GetReaderDocument() { return m_pDocument; }
- CPDFDoc_Environment * GetReaderApp(){return m_pApp;}
+ CPDFDoc_Environment* GetReaderApp() { return m_pApp; }
- FX_BOOL InitJSObjects();
+ FX_BOOL InitJSObjects();
- FX_BOOL AddEventToLoop(const CFX_WideString& sTargetName, JS_EVENT_T eEventType);
- void RemoveEventInLoop(const CFX_WideString& sTargetName, JS_EVENT_T eEventType);
- void RemoveEventsInLoop(CJS_FieldEvent* pStart);
+ FX_BOOL AddEventToLoop(const CFX_WideString& sTargetName,
+ JS_EVENT_T eEventType);
+ void RemoveEventInLoop(const CFX_WideString& sTargetName,
+ JS_EVENT_T eEventType);
+ void RemoveEventsInLoop(CJS_FieldEvent* pStart);
- void BeginBlock(){m_bBlocking = TRUE;}
- void EndBlock(){m_bBlocking = FALSE;}
- FX_BOOL IsBlocking(){return m_bBlocking;}
+ void BeginBlock() { m_bBlocking = TRUE; }
+ void EndBlock() { m_bBlocking = FALSE; }
+ FX_BOOL IsBlocking() { return m_bBlocking; }
- operator IJS_Runtime*() {return (IJS_Runtime*)m_isolate;}
- v8::Isolate* GetIsolate(){return m_isolate;};
- void SetIsolate(v8::Isolate* isolate){m_isolate = isolate;}
+ operator IJS_Runtime*() { return (IJS_Runtime*)m_isolate; }
+ v8::Isolate* GetIsolate() { return m_isolate; };
+ void SetIsolate(v8::Isolate* isolate) { m_isolate = isolate; }
- v8::Local<v8::Context> NewJSContext();
+ v8::Local<v8::Context> NewJSContext();
+ virtual FX_BOOL GetHValueByName(const CFX_ByteStringC& utf8Name,
+ FXJSE_HVALUE hValue);
+ virtual FX_BOOL SetHValueByName(const CFX_ByteStringC& utf8Name,
+ FXJSE_HVALUE hValue);
- virtual FX_BOOL GetHValueByName(const CFX_ByteStringC& utf8Name, FXJSE_HVALUE hValue);
- virtual FX_BOOL SetHValueByName(const CFX_ByteStringC& utf8Name, FXJSE_HVALUE hValue);
-protected:
- CFX_ArrayTemplate<CJS_Context*> m_ContextArray;
- CPDFDoc_Environment* m_pApp;
- CPDFSDK_Document* m_pDocument;
- FX_BOOL m_bBlocking;
- CJS_FieldEvent* m_pFieldEventPath;
+ protected:
+ CFX_ArrayTemplate<CJS_Context*> m_ContextArray;
+ CPDFDoc_Environment* m_pApp;
+ CPDFSDK_Document* m_pDocument;
+ FX_BOOL m_bBlocking;
+ CJS_FieldEvent* m_pFieldEventPath;
- v8::Isolate* m_isolate;
- nonstd::unique_ptr<CJS_ArrayBufferAllocator> m_pArrayBufferAllocator;
- v8::Global<v8::Context> m_context;
+ v8::Isolate* m_isolate;
+ nonstd::unique_ptr<CJS_ArrayBufferAllocator> m_pArrayBufferAllocator;
+ v8::Global<v8::Context> m_context;
};
#endif // FPDFSDK_INCLUDE_JAVASCRIPT_JS_RUNTIME_H_