diff options
author | dsinclair <dsinclair@chromium.org> | 2016-05-26 10:14:00 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-05-26 10:14:00 -0700 |
commit | e9885e77a7daf7a8d45eaf0290a1ea5f208c24c6 (patch) | |
tree | 0d5006c9b2ab336e785a4a812f96a16ab6d527f5 | |
parent | d2b93dfa15dbb7fd42b7cf05fc248d7f5c87f1ef (diff) | |
download | pdfium-e9885e77a7daf7a8d45eaf0290a1ea5f208c24c6.tar.xz |
Replace FXJSE_HCLASS with CFXJSE_Class*
This CL removes FXJSE_HCLASS and replaces with CFXJSE_Class*. All variables have
been updated to the new type.
Review-Url: https://codereview.chromium.org/2014213002
-rw-r--r-- | xfa/fxfa/fm2js/xfa_fm2jscontext.cpp | 6 | ||||
-rw-r--r-- | xfa/fxfa/fm2js/xfa_fm2jscontext.h | 2 | ||||
-rw-r--r-- | xfa/fxfa/parser/xfa_script_imp.cpp | 10 | ||||
-rw-r--r-- | xfa/fxfa/parser/xfa_script_imp.h | 4 | ||||
-rw-r--r-- | xfa/fxjse/cfxjse_arguments.h | 2 | ||||
-rw-r--r-- | xfa/fxjse/class.cpp | 12 | ||||
-rw-r--r-- | xfa/fxjse/include/fxjse.h | 10 | ||||
-rw-r--r-- | xfa/fxjse/value.cpp | 12 |
8 files changed, 27 insertions, 31 deletions
diff --git a/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp b/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp index f875ad2713..add3e8ab3f 100644 --- a/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp +++ b/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp @@ -7164,7 +7164,7 @@ static FXJSE_FUNCTION formcalc_fm2js_functions[] = { {"fm_var_filter", CXFA_FM2JSContext::fm_var_filter}, }; CXFA_FM2JSContext::CXFA_FM2JSContext() - : m_hFMClass(nullptr), m_pDocument(nullptr) { + : m_pFMClass(nullptr), m_pDocument(nullptr) { FXSYS_memset(&m_fmClass, 0, sizeof(FXJSE_CLASS)); } CXFA_FM2JSContext::~CXFA_FM2JSContext() { @@ -7187,10 +7187,10 @@ void CXFA_FM2JSContext::Initialize(v8::Isolate* pScriptIsolate, m_fmClass.propNum = 0; m_fmClass.methNum = sizeof(formcalc_fm2js_functions) / sizeof(formcalc_fm2js_functions[0]); - m_hFMClass = FXJSE_DefineClass(pScriptContext, &m_fmClass); + m_pFMClass = FXJSE_DefineClass(pScriptContext, &m_fmClass); m_hValue = FXJSE_Value_Create(pScriptIsolate); FXJSE_Value_SetNull(m_hValue); - FXJSE_Value_SetObject(m_hValue, this, m_hFMClass); + FXJSE_Value_SetObject(m_hValue, this, m_pFMClass); } void CXFA_FM2JSContext::GlobalPropertyGetter(FXJSE_HVALUE hValue) { FXJSE_Value_Set(hValue, m_hValue); diff --git a/xfa/fxfa/fm2js/xfa_fm2jscontext.h b/xfa/fxfa/fm2js/xfa_fm2jscontext.h index 997b32fe59..81cf08b2a5 100644 --- a/xfa/fxfa/fm2js/xfa_fm2jscontext.h +++ b/xfa/fxfa/fm2js/xfa_fm2jscontext.h @@ -447,7 +447,7 @@ class CXFA_FM2JSContext { private: v8::Isolate* m_pIsolate; FXJSE_CLASS m_fmClass; - FXJSE_HCLASS m_hFMClass; + CFXJSE_Class* m_pFMClass; FXJSE_HVALUE m_hValue; CXFA_Document* m_pDocument; }; diff --git a/xfa/fxfa/parser/xfa_script_imp.cpp b/xfa/fxfa/parser/xfa_script_imp.cpp index c29e7a88d0..c55a66cf9a 100644 --- a/xfa/fxfa/parser/xfa_script_imp.cpp +++ b/xfa/fxfa/parser/xfa_script_imp.cpp @@ -24,7 +24,7 @@ CXFA_ScriptContext::CXFA_ScriptContext(CXFA_Document* pDocument) : m_pDocument(pDocument), m_pJsContext(nullptr), m_pIsolate(nullptr), - m_hJsClass(nullptr), + m_pJsClass(nullptr), m_eScriptType(XFA_SCRIPTLANGTYPE_Unkown), m_pScriptNodeArray(nullptr), m_pResolveProcessor(nullptr), @@ -532,7 +532,7 @@ void CXFA_ScriptContext::DefineJsClass() { m_JsNormalClass.dynPropTypeGetter = CXFA_ScriptContext::NormalPropTypeGetter; m_JsNormalClass.dynPropDeleter = NULL; m_JsNormalClass.dynMethodCall = CXFA_ScriptContext::NormalMethodCall; - m_hJsClass = FXJSE_DefineClass(m_pJsContext, &m_JsNormalClass); + m_pJsClass = FXJSE_DefineClass(m_pJsContext, &m_JsNormalClass); } void CXFA_ScriptContext::RemoveBuiltInObjs(CFXJSE_Context* pContext) const { static const CFX_ByteStringC OBJ_NAME[2] = {"Number", "Date"}; @@ -545,8 +545,8 @@ void CXFA_ScriptContext::RemoveBuiltInObjs(CFXJSE_Context* pContext) const { FXJSE_Value_Release(hProp); FXJSE_Value_Release(hObject); } -FXJSE_HCLASS CXFA_ScriptContext::GetJseNormalClass() { - return m_hJsClass; +CFXJSE_Class* CXFA_ScriptContext::GetJseNormalClass() { + return m_pJsClass; } int32_t CXFA_ScriptContext::ResolveObjects(CXFA_Object* refNode, const CFX_WideStringC& wsExpression, @@ -722,7 +722,7 @@ FXJSE_HVALUE CXFA_ScriptContext::GetJSValueFromMap(CXFA_Object* pObject) { void* pValue = m_mapXFAToHValue.GetValueAt(pObject); if (pValue == NULL) { FXJSE_HVALUE jsHvalue = FXJSE_Value_Create(m_pIsolate); - FXJSE_Value_SetObject(jsHvalue, pObject, m_hJsClass); + FXJSE_Value_SetObject(jsHvalue, pObject, m_pJsClass); m_mapXFAToHValue.SetAt(pObject, jsHvalue); pValue = jsHvalue; } diff --git a/xfa/fxfa/parser/xfa_script_imp.h b/xfa/fxfa/parser/xfa_script_imp.h index 2efd58914b..5d1269b767 100644 --- a/xfa/fxfa/parser/xfa_script_imp.h +++ b/xfa/fxfa/parser/xfa_script_imp.h @@ -48,7 +48,7 @@ class CXFA_ScriptContext { void SetNodesOfRunScript(CXFA_NodeArray* pArray); void AddNodesOfRunScript(const CXFA_NodeArray& nodes); void AddNodesOfRunScript(CXFA_Node* pNode); - FXJSE_HCLASS GetJseNormalClass(); + CFXJSE_Class* GetJseNormalClass(); void SetRunAtType(XFA_ATTRIBUTEENUM eRunAt) { m_eRunAtType = eRunAt; } FX_BOOL IsRunAtClient() { return m_eRunAtType != XFA_ATTRIBUTEENUM_Server; } @@ -103,7 +103,7 @@ class CXFA_ScriptContext { CXFA_Document* m_pDocument; CFXJSE_Context* m_pJsContext; v8::Isolate* m_pIsolate; - FXJSE_HCLASS m_hJsClass; + CFXJSE_Class* m_pJsClass; XFA_SCRIPTLANGTYPE m_eScriptType; FXJSE_CLASS m_JsGlobalClass; FXJSE_CLASS m_JsNormalClass; diff --git a/xfa/fxjse/cfxjse_arguments.h b/xfa/fxjse/cfxjse_arguments.h index 423e22d888..d86ec0f1f8 100644 --- a/xfa/fxjse/cfxjse_arguments.h +++ b/xfa/fxjse/cfxjse_arguments.h @@ -18,7 +18,7 @@ class CFXJSE_Arguments { int32_t GetInt32(int32_t index) const; FX_FLOAT GetFloat(int32_t index) const; CFX_ByteString GetUTF8String(int32_t index) const; - void* GetObject(int32_t index, FXJSE_HCLASS hClass = nullptr) const; + void* GetObject(int32_t index, CFXJSE_Class* hClass = nullptr) const; FXJSE_HVALUE GetReturnValue(); }; diff --git a/xfa/fxjse/class.cpp b/xfa/fxjse/class.cpp index b7637455fd..6d0a719821 100644 --- a/xfa/fxjse/class.cpp +++ b/xfa/fxjse/class.cpp @@ -24,11 +24,10 @@ static void FXJSE_V8SetterCallback_Wrapper( v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<void>& info); -FXJSE_HCLASS FXJSE_DefineClass(CFXJSE_Context* pContext, - const FXJSE_CLASS* lpClass) { +CFXJSE_Class* FXJSE_DefineClass(CFXJSE_Context* pContext, + const FXJSE_CLASS* lpClass) { ASSERT(pContext); - return reinterpret_cast<FXJSE_HCLASS>( - CFXJSE_Class::Create(pContext, lpClass, FALSE)); + return CFXJSE_Class::Create(pContext, lpClass, FALSE); } static void FXJSE_V8FunctionCallback_Wrapper( @@ -182,7 +181,7 @@ CFX_ByteString CFXJSE_Arguments::GetUTF8String(int32_t index) const { return CFX_ByteString(*szStringVal); } -void* CFXJSE_Arguments::GetObject(int32_t index, FXJSE_HCLASS hClass) const { +void* CFXJSE_Arguments::GetObject(int32_t index, CFXJSE_Class* pClass) const { const CFXJSE_ArgumentsImpl* lpArguments = reinterpret_cast<const CFXJSE_ArgumentsImpl* const>(this); v8::Local<v8::Value> hValue = (*lpArguments->m_pInfo)[index]; @@ -190,8 +189,7 @@ void* CFXJSE_Arguments::GetObject(int32_t index, FXJSE_HCLASS hClass) const { if (!hValue->IsObject()) { return NULL; } - CFXJSE_Class* lpClass = reinterpret_cast<CFXJSE_Class*>(hClass); - return FXJSE_RetrieveObjectBinding(hValue.As<v8::Object>(), lpClass); + return FXJSE_RetrieveObjectBinding(hValue.As<v8::Object>(), pClass); } FXJSE_HVALUE CFXJSE_Arguments::GetReturnValue() { diff --git a/xfa/fxjse/include/fxjse.h b/xfa/fxjse/include/fxjse.h index 207d86e68c..5cf2d2abb7 100644 --- a/xfa/fxjse/include/fxjse.h +++ b/xfa/fxjse/include/fxjse.h @@ -12,9 +12,9 @@ #include "v8/include/v8.h" class CFXJSE_Arguments; +class CFXJSE_Class; class CFXJSE_Context; -typedef struct FXJSE_HCLASS_ { void* pData; } * FXJSE_HCLASS; typedef struct FXJSE_HVALUE_ { void* pData; } * FXJSE_HVALUE; // NOLINTNEXTLINE typedef struct FXJSE_HOBJECT_ : public FXJSE_HVALUE_{} * FXJSE_HOBJECT; @@ -82,8 +82,8 @@ FXJSE_HVALUE FXJSE_Context_GetGlobalObject(CFXJSE_Context* pContext); void FXJSE_Context_EnableCompatibleMode(CFXJSE_Context* pContext, uint32_t dwCompatibleFlags); -FXJSE_HCLASS FXJSE_DefineClass(CFXJSE_Context* pContext, - const FXJSE_CLASS* lpClass); +CFXJSE_Class* FXJSE_DefineClass(CFXJSE_Context* pContext, + const FXJSE_CLASS* lpClass); FXJSE_HVALUE FXJSE_Value_Create(v8::Isolate* pIsolate); void FXJSE_Value_Release(FXJSE_HVALUE hValue); @@ -102,7 +102,7 @@ FX_FLOAT FXJSE_Value_ToFloat(FXJSE_HVALUE hValue); double FXJSE_Value_ToDouble(FXJSE_HVALUE hValue); int32_t FXJSE_Value_ToInteger(FXJSE_HVALUE hValue); void FXJSE_Value_ToUTF8String(FXJSE_HVALUE hValue, CFX_ByteString& szStrOutput); -void* FXJSE_Value_ToObject(FXJSE_HVALUE hValue, FXJSE_HCLASS hClass); +void* FXJSE_Value_ToObject(FXJSE_HVALUE hValue, CFXJSE_Class* hClass); void FXJSE_Value_SetUndefined(FXJSE_HVALUE hValue); void FXJSE_Value_SetNull(FXJSE_HVALUE hValue); @@ -114,7 +114,7 @@ void FXJSE_Value_SetFloat(FXJSE_HVALUE hValue, FX_FLOAT fFloat); void FXJSE_Value_SetDouble(FXJSE_HVALUE hValue, double dDouble); void FXJSE_Value_SetObject(FXJSE_HVALUE hValue, void* lpObject, - FXJSE_HCLASS hClass); + CFXJSE_Class* pClass); void FXJSE_Value_SetArray(FXJSE_HVALUE hValue, uint32_t uValueCount, FXJSE_HVALUE* rgValues); diff --git a/xfa/fxjse/value.cpp b/xfa/fxjse/value.cpp index c23e12c32f..a9f73b2755 100644 --- a/xfa/fxjse/value.cpp +++ b/xfa/fxjse/value.cpp @@ -72,9 +72,8 @@ int32_t FXJSE_Value_ToInteger(FXJSE_HVALUE hValue) { return reinterpret_cast<CFXJSE_Value*>(hValue)->ToInteger(); } -void* FXJSE_Value_ToObject(FXJSE_HVALUE hValue, FXJSE_HCLASS hClass) { - CFXJSE_Class* lpClass = reinterpret_cast<CFXJSE_Class*>(hClass); - return reinterpret_cast<CFXJSE_Value*>(hValue)->ToObject(lpClass); +void* FXJSE_Value_ToObject(FXJSE_HVALUE hValue, CFXJSE_Class* pClass) { + return reinterpret_cast<CFXJSE_Value*>(hValue)->ToObject(pClass); } void FXJSE_Value_SetUndefined(FXJSE_HVALUE hValue) { @@ -108,14 +107,13 @@ void FXJSE_Value_SetDouble(FXJSE_HVALUE hValue, double dDouble) { void FXJSE_Value_SetObject(FXJSE_HVALUE hValue, void* lpObject, - FXJSE_HCLASS hClass) { + CFXJSE_Class* pClass) { CFXJSE_Value* lpValue = reinterpret_cast<CFXJSE_Value*>(hValue); - CFXJSE_Class* lpClass = reinterpret_cast<CFXJSE_Class*>(hClass); - if (!lpClass) { + if (!pClass) { ASSERT(!lpObject); lpValue->SetJSObject(); } else { - lpValue->SetHostObject(lpObject, lpClass); + lpValue->SetHostObject(lpObject, pClass); } } |