diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-12-04 16:39:06 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-12-04 16:39:06 +0000 |
commit | ddf945fc297356062eb8ba07b2d58e65a09b152b (patch) | |
tree | 36ba73d65c709547f64eca8310c8c01a181c3dbd /fxjs/cfxjse_engine.h | |
parent | d1fe53b26814f711b37e77fedaf371393423b779 (diff) | |
download | pdfium-ddf945fc297356062eb8ba07b2d58e65a09b152b.tar.xz |
Cleanup CFXJSE_Engine visibility
This CL makes CFXJSE_Engine methods private where possible and shuffles
static methods to the top of the declarations.
Change-Id: Ife84ce30d00e126bcbc5cb86d1a189eec2c7cb1c
Reviewed-on: https://pdfium-review.googlesource.com/20310
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fxjs/cfxjse_engine.h')
-rw-r--r-- | fxjs/cfxjse_engine.h | 71 |
1 files changed, 34 insertions, 37 deletions
diff --git a/fxjs/cfxjse_engine.h b/fxjs/cfxjse_engine.h index 1409f71001..66fe7a53e8 100644 --- a/fxjs/cfxjse_engine.h +++ b/fxjs/cfxjse_engine.h @@ -23,6 +23,29 @@ class CFXJSE_ResolveProcessor; class CFXJSE_Engine { public: + static CXFA_Object* ToObject(CFXJSE_Value* pValue, CFXJSE_Class* pClass); + static void GlobalPropertyGetter(CFXJSE_Value* pObject, + const ByteStringView& szPropName, + CFXJSE_Value* pValue); + static void GlobalPropertySetter(CFXJSE_Value* pObject, + const ByteStringView& szPropName, + CFXJSE_Value* pValue); + static void NormalPropertyGetter(CFXJSE_Value* pObject, + const ByteStringView& szPropName, + CFXJSE_Value* pValue); + static void NormalPropertySetter(CFXJSE_Value* pObject, + const ByteStringView& szPropName, + CFXJSE_Value* pValue); + static void NormalMethodCall(CFXJSE_Value* hThis, + const ByteStringView& szFuncName, + CFXJSE_Arguments& args); + static int32_t NormalPropTypeGetter(CFXJSE_Value* pObject, + const ByteStringView& szPropName, + bool bQueryIn); + static int32_t GlobalPropTypeGetter(CFXJSE_Value* pObject, + const ByteStringView& szPropName, + bool bQueryIn); + explicit CFXJSE_Engine(CXFA_Document* pDocument, v8::Isolate* pIsolate); ~CFXJSE_Engine(); @@ -48,57 +71,32 @@ class CFXJSE_Engine { void GetSomExpression(CXFA_Node* refNode, WideString& wsExpression); void SetNodesOfRunScript(std::vector<CXFA_Node*>* pArray); - void AddNodesOfRunScript(const std::vector<CXFA_Node*>& nodes); void AddNodesOfRunScript(CXFA_Node* pNode); CFXJSE_Class* GetJseNormalClass(); void SetRunAtType(XFA_AttributeEnum eRunAt) { m_eRunAtType = eRunAt; } bool IsRunAtClient() { return m_eRunAtType != XFA_AttributeEnum::Server; } + + CXFA_ScriptData::Type GetType(); + std::vector<CXFA_Node*>* GetUpObjectArray() { return &m_upObjectArray; } + CXFA_Document* GetDocument() const { return m_pDocument.Get(); } + + private: + CFXJSE_Context* CreateVariablesContext(CXFA_Node* pScriptNode, + CXFA_Node* pSubform); + void RemoveBuiltInObjs(CFXJSE_Context* pContext) const; bool QueryNodeByFlag(CXFA_Node* refNode, const WideStringView& propname, CFXJSE_Value* pValue, uint32_t dwFlag, bool bSetting); + bool IsStrictScopeInJavaScript(); + CXFA_Object* GetVariablesThis(CXFA_Object* pObject, bool bScriptNode = false); bool QueryVariableValue(CXFA_Node* pScriptNode, const ByteStringView& szPropName, CFXJSE_Value* pValue, bool bGetter); - bool QueryBuiltinValue(const ByteStringView& szPropName, - CFXJSE_Value* pValue); - static void GlobalPropertyGetter(CFXJSE_Value* pObject, - const ByteStringView& szPropName, - CFXJSE_Value* pValue); - static void GlobalPropertySetter(CFXJSE_Value* pObject, - const ByteStringView& szPropName, - CFXJSE_Value* pValue); - static void NormalPropertyGetter(CFXJSE_Value* pObject, - const ByteStringView& szPropName, - CFXJSE_Value* pValue); - static void NormalPropertySetter(CFXJSE_Value* pObject, - const ByteStringView& szPropName, - CFXJSE_Value* pValue); - static void NormalMethodCall(CFXJSE_Value* hThis, - const ByteStringView& szFuncName, - CFXJSE_Arguments& args); - static int32_t NormalPropTypeGetter(CFXJSE_Value* pObject, - const ByteStringView& szPropName, - bool bQueryIn); - static int32_t GlobalPropTypeGetter(CFXJSE_Value* pObject, - const ByteStringView& szPropName, - bool bQueryIn); bool RunVariablesScript(CXFA_Node* pScriptNode); - CXFA_Object* GetVariablesThis(CXFA_Object* pObject, bool bScriptNode = false); - bool IsStrictScopeInJavaScript(); - CXFA_ScriptData::Type GetType(); - std::vector<CXFA_Node*>* GetUpObjectArray() { return &m_upObjectArray; } - CXFA_Document* GetDocument() const { return m_pDocument.Get(); } - - static CXFA_Object* ToObject(CFXJSE_Value* pValue, CFXJSE_Class* pClass); - - private: - CFXJSE_Context* CreateVariablesContext(CXFA_Node* pScriptNode, - CXFA_Node* pSubform); - void RemoveBuiltInObjs(CFXJSE_Context* pContext) const; UnownedPtr<CXFA_Document> const m_pDocument; std::unique_ptr<CFXJSE_Context> m_JsContext; @@ -116,7 +114,6 @@ class CFXJSE_Engine { std::unique_ptr<CFXJSE_ResolveProcessor> m_ResolveProcessor; std::unique_ptr<CFXJSE_FormCalcContext> m_FM2JSContext; CXFA_Object* m_pThisObject; - uint32_t m_dwBuiltInInFlags; XFA_AttributeEnum m_eRunAtType; }; |