summaryrefslogtreecommitdiff
path: root/fpdfsdk/javascript/global.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-10-23 09:44:30 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-10-23 17:57:28 +0000
commit33d13f2231a07e7b32ff25da6a6a28cb619d18a9 (patch)
tree8be1d6a857dff58d8aacbc1dc722fceac8343235 /fpdfsdk/javascript/global.cpp
parentc970895f94cf76eb738d0a583ae139fecdd85268 (diff)
downloadpdfium-33d13f2231a07e7b32ff25da6a6a28cb619d18a9.tar.xz
Remove CJS_PropValue
This CL removes the CJS_PropValue class and uses CJS_Value directly. The various Set methods have been moved to CJS_Value and the runtime provided as needed. Change-Id: Ib5d3b9efc9b6cf8182be8f19af98599379c3d7db Reviewed-on: https://pdfium-review.googlesource.com/16431 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fpdfsdk/javascript/global.cpp')
-rw-r--r--fpdfsdk/javascript/global.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/fpdfsdk/javascript/global.cpp b/fpdfsdk/javascript/global.cpp
index 4635f1c84c..7c82e4d542 100644
--- a/fpdfsdk/javascript/global.cpp
+++ b/fpdfsdk/javascript/global.cpp
@@ -77,36 +77,36 @@ bool JSGlobalAlternate::DelProperty(CJS_Runtime* pRuntime,
bool JSGlobalAlternate::GetProperty(CJS_Runtime* pRuntime,
const wchar_t* propname,
- CJS_PropValue* vp) {
+ CJS_Value* vp) {
auto it = m_MapGlobal.find(ByteString::FromUnicode(propname));
if (it == m_MapGlobal.end()) {
- vp->GetJSValue()->SetNull(pRuntime);
+ vp->SetNull(pRuntime);
return true;
}
JSGlobalData* pData = it->second.get();
if (pData->bDeleted) {
- vp->GetJSValue()->SetNull(pRuntime);
+ vp->SetNull(pRuntime);
return true;
}
switch (pData->nType) {
case JS_GlobalDataType::NUMBER:
- vp->Set(pData->dData);
+ vp->Set(pRuntime, pData->dData);
return true;
case JS_GlobalDataType::BOOLEAN:
- vp->Set(pData->bData);
+ vp->Set(pRuntime, pData->bData);
return true;
case JS_GlobalDataType::STRING:
- vp->Set(pData->sData);
+ vp->Set(pRuntime, pData->sData);
return true;
case JS_GlobalDataType::OBJECT: {
- vp->Set(v8::Local<v8::Object>::New(vp->GetJSRuntime()->GetIsolate(),
- pData->pData));
+ vp->Set(pRuntime,
+ v8::Local<v8::Object>::New(pRuntime->GetIsolate(), pData->pData));
return true;
}
case JS_GlobalDataType::NULLOBJ:
- vp->GetJSValue()->SetNull(pRuntime);
+ vp->SetNull(pRuntime);
return true;
default:
break;
@@ -116,24 +116,24 @@ bool JSGlobalAlternate::GetProperty(CJS_Runtime* pRuntime,
bool JSGlobalAlternate::SetProperty(CJS_Runtime* pRuntime,
const wchar_t* propname,
- const CJS_PropValue& vp) {
+ const CJS_Value& vp) {
ByteString sPropName = ByteString::FromUnicode(propname);
- switch (vp.GetJSValue()->GetType()) {
+ switch (vp.GetType()) {
case CJS_Value::VT_number:
return SetGlobalVariables(sPropName, JS_GlobalDataType::NUMBER,
- vp.ToDouble(), false, "",
+ vp.ToDouble(pRuntime), false, "",
v8::Local<v8::Object>(), false);
case CJS_Value::VT_boolean:
return SetGlobalVariables(sPropName, JS_GlobalDataType::BOOLEAN, 0,
- vp.ToBool(), "", v8::Local<v8::Object>(),
- false);
+ vp.ToBool(pRuntime), "",
+ v8::Local<v8::Object>(), false);
case CJS_Value::VT_string:
return SetGlobalVariables(sPropName, JS_GlobalDataType::STRING, 0, false,
- vp.ToByteString(), v8::Local<v8::Object>(),
- false);
+ vp.ToByteString(pRuntime),
+ v8::Local<v8::Object>(), false);
case CJS_Value::VT_object:
return SetGlobalVariables(sPropName, JS_GlobalDataType::OBJECT, 0, false,
- "", vp.ToV8Object(), false);
+ "", vp.ToV8Object(pRuntime), false);
case CJS_Value::VT_null:
return SetGlobalVariables(sPropName, JS_GlobalDataType::NULLOBJ, 0, false,
"", v8::Local<v8::Object>(), false);