From 818e1900a3811e1bde1e594e4966db612f845966 Mon Sep 17 00:00:00 2001 From: dsinclair Date: Wed, 25 May 2016 19:36:59 -0700 Subject: Remove parameters which are always null These parameters are never set, remove them and their supporting code. Review-Url: https://codereview.chromium.org/2009413002 --- xfa/fxjse/cfxjse_arguments.h | 2 +- xfa/fxjse/class.cpp | 5 ++--- xfa/fxjse/include/fxjse.h | 2 +- xfa/fxjse/util_inline.h | 11 +---------- xfa/fxjse/value.cpp | 9 ++++----- xfa/fxjse/value.h | 2 +- 6 files changed, 10 insertions(+), 21 deletions(-) (limited to 'xfa/fxjse') diff --git a/xfa/fxjse/cfxjse_arguments.h b/xfa/fxjse/cfxjse_arguments.h index 423e22d888..d7b6734e14 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) const; FXJSE_HVALUE GetReturnValue(); }; diff --git a/xfa/fxjse/class.cpp b/xfa/fxjse/class.cpp index ff5990aa85..18c542a65e 100644 --- a/xfa/fxjse/class.cpp +++ b/xfa/fxjse/class.cpp @@ -183,7 +183,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) const { const CFXJSE_ArgumentsImpl* lpArguments = reinterpret_cast(this); v8::Local hValue = (*lpArguments->m_pInfo)[index]; @@ -191,8 +191,7 @@ void* CFXJSE_Arguments::GetObject(int32_t index, FXJSE_HCLASS hClass) const { if (!hValue->IsObject()) { return NULL; } - CFXJSE_Class* lpClass = reinterpret_cast(hClass); - return FXJSE_RetrieveObjectBinding(hValue.As(), lpClass); + return FXJSE_RetrieveObjectBinding(hValue.As()); } FXJSE_HVALUE CFXJSE_Arguments::GetReturnValue() { diff --git a/xfa/fxjse/include/fxjse.h b/xfa/fxjse/include/fxjse.h index d009372c54..fce1b969fb 100644 --- a/xfa/fxjse/include/fxjse.h +++ b/xfa/fxjse/include/fxjse.h @@ -103,7 +103,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); void FXJSE_Value_SetUndefined(FXJSE_HVALUE hValue); void FXJSE_Value_SetNull(FXJSE_HVALUE hValue); diff --git a/xfa/fxjse/util_inline.h b/xfa/fxjse/util_inline.h index e61dc6aa80..336886b666 100644 --- a/xfa/fxjse/util_inline.h +++ b/xfa/fxjse/util_inline.h @@ -20,8 +20,7 @@ static V8_INLINE void FXJSE_UpdateObjectBinding(v8::Local& hObject, hObject->SetAlignedPointerInInternalField(0, lpNewBinding); } static V8_INLINE void* FXJSE_RetrieveObjectBinding( - const v8::Local& hJSObject, - CFXJSE_Class* lpClass = NULL) { + const v8::Local& hJSObject) { ASSERT(!hJSObject.IsEmpty()); if (!hJSObject->IsObject()) { return NULL; @@ -37,14 +36,6 @@ static V8_INLINE void* FXJSE_RetrieveObjectBinding( return NULL; } } - if (lpClass) { - v8::Local hClass = - v8::Local::New( - lpClass->GetContext()->GetRuntime(), lpClass->GetTemplate()); - if (!hClass->HasInstance(hObject)) { - return NULL; - } - } return hObject->GetAlignedPointerFromInternalField(0); } diff --git a/xfa/fxjse/value.cpp b/xfa/fxjse/value.cpp index c23e12c32f..d3366cf08e 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(hValue)->ToInteger(); } -void* FXJSE_Value_ToObject(FXJSE_HVALUE hValue, FXJSE_HCLASS hClass) { - CFXJSE_Class* lpClass = reinterpret_cast(hClass); - return reinterpret_cast(hValue)->ToObject(lpClass); +void* FXJSE_Value_ToObject(FXJSE_HVALUE hValue) { + return reinterpret_cast(hValue)->ToObject(); } void FXJSE_Value_SetUndefined(FXJSE_HVALUE hValue) { @@ -238,7 +237,7 @@ CFXJSE_Value* CFXJSE_Value::Create(v8::Isolate* pIsolate) { return new CFXJSE_Value(pIsolate); } -void* CFXJSE_Value::ToObject(CFXJSE_Class* lpClass) const { +void* CFXJSE_Value::ToObject() const { ASSERT(!m_hValue.IsEmpty()); CFXJSE_ScopeUtil_IsolateHandleRootContext scope(m_pIsolate); @@ -248,7 +247,7 @@ void* CFXJSE_Value::ToObject(CFXJSE_Class* lpClass) const { if (!hValue->IsObject()) return nullptr; - return FXJSE_RetrieveObjectBinding(hValue.As(), lpClass); + return FXJSE_RetrieveObjectBinding(hValue.As()); } V8_INLINE static double FXJSE_ftod(FX_FLOAT fNumber) { diff --git a/xfa/fxjse/value.h b/xfa/fxjse/value.h index 2939ac34f7..12db5883cf 100644 --- a/xfa/fxjse/value.h +++ b/xfa/fxjse/value.h @@ -148,7 +148,7 @@ class CFXJSE_Value { v8::String::Utf8Value hStringVal(hString); szStrOutput = *hStringVal; } - void* ToObject(CFXJSE_Class* lpClass) const; + void* ToObject() const; public: V8_INLINE void SetUndefined() { -- cgit v1.2.3