summaryrefslogtreecommitdiff
path: root/xfa/fxjse/value.cpp
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-05-31 14:22:09 -0700
committerCommit bot <commit-bot@chromium.org>2016-05-31 14:22:09 -0700
commit29adee77d4a7566bc6832cc825198c0571426163 (patch)
treee8fd009fe853b4d8aad499d6e92cfff8f7dd6efa /xfa/fxjse/value.cpp
parentfb96900eeea15b252245b0caf4330a5ade369172 (diff)
downloadpdfium-29adee77d4a7566bc6832cc825198c0571426163.tar.xz
Replace void* with CFXJSE_HostObect and make wrapped objects inherit from it
This will avoid a re-occurrence of BUG 613607 should someone again optimize away CXFA_Object's virtual dtor. Review-Url: https://codereview.chromium.org/2019333006
Diffstat (limited to 'xfa/fxjse/value.cpp')
-rw-r--r--xfa/fxjse/value.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/xfa/fxjse/value.cpp b/xfa/fxjse/value.cpp
index 6cdbb14aa3..b369c0bf3b 100644
--- a/xfa/fxjse/value.cpp
+++ b/xfa/fxjse/value.cpp
@@ -64,7 +64,8 @@ int32_t FXJSE_Value_ToInteger(CFXJSE_Value* pValue) {
return pValue->ToInteger();
}
-void* FXJSE_Value_ToObject(CFXJSE_Value* pValue, CFXJSE_Class* pClass) {
+CFXJSE_HostObject* FXJSE_Value_ToObject(CFXJSE_Value* pValue,
+ CFXJSE_Class* pClass) {
return pValue->ToObject(pClass);
}
@@ -98,14 +99,14 @@ void FXJSE_Value_SetDouble(CFXJSE_Value* pValue, double dDouble) {
}
void FXJSE_Value_SetObject(CFXJSE_Value* pValue,
- void* lpObject,
+ CFXJSE_HostObject* lpObject,
CFXJSE_Class* pClass) {
if (!pClass) {
ASSERT(!lpObject);
pValue->SetJSObject();
- } else {
- pValue->SetHostObject(lpObject, pClass);
+ return;
}
+ pValue->SetHostObject(lpObject, pClass);
}
void FXJSE_Value_SetArray(CFXJSE_Value* pValue,
@@ -197,7 +198,7 @@ void FXJSE_ThrowMessage(const CFX_ByteStringC& utf8Name,
pIsolate->ThrowException(hError);
}
-void* CFXJSE_Value::ToObject(CFXJSE_Class* lpClass) const {
+CFXJSE_HostObject* CFXJSE_Value::ToObject(CFXJSE_Class* lpClass) const {
ASSERT(!m_hValue.IsEmpty());
CFXJSE_ScopeUtil_IsolateHandleRootContext scope(m_pIsolate);
@@ -256,7 +257,8 @@ void CFXJSE_Value::SetFloat(FX_FLOAT fFloat) {
m_hValue.Reset(m_pIsolate, pValue);
}
-void CFXJSE_Value::SetHostObject(void* lpObject, CFXJSE_Class* lpClass) {
+void CFXJSE_Value::SetHostObject(CFXJSE_HostObject* lpObject,
+ CFXJSE_Class* lpClass) {
CFXJSE_ScopeUtil_IsolateHandleRootContext scope(m_pIsolate);
ASSERT(lpClass);
v8::Local<v8::FunctionTemplate> hClass =