Kill majority of remaining CFXJSE_Value usage in fxjs/xfa
Bug: pdfium:1610
Change-Id: Ie61f397d186db28b1508a7913556cb48091a3dc5
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/76570
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Daniel Hosseinian <dhoss@chromium.org>
diff --git a/fxjs/xfa/cjx_subform.cpp b/fxjs/xfa/cjx_subform.cpp
index 4162b1d..e555012 100644
--- a/fxjs/xfa/cjx_subform.cpp
+++ b/fxjs/xfa/cjx_subform.cpp
@@ -9,9 +9,9 @@
#include <vector>
#include "fxjs/cfx_v8.h"
+#include "fxjs/fxv8.h"
#include "fxjs/js_resources.h"
#include "fxjs/xfa/cfxjse_engine.h"
-#include "fxjs/xfa/cfxjse_value.h"
#include "xfa/fxfa/cxfa_eventparam.h"
#include "xfa/fxfa/cxfa_ffnotify.h"
#include "xfa/fxfa/fxfa.h"
@@ -88,21 +88,23 @@
}
void CJX_Subform::locale(v8::Isolate* pIsolate,
- CFXJSE_Value* pValue,
+ v8::Local<v8::Value>* pValue,
bool bSetting,
XFA_Attribute eAttribute) {
if (bSetting) {
- SetCDataImpl(XFA_Attribute::Locale, pValue->ToWideString(pIsolate), true,
+ SetCDataImpl(XFA_Attribute::Locale,
+ fxv8::ReentrantToWideStringHelper(pIsolate, *pValue), true,
true);
return;
}
WideString wsLocaleName = GetXFANode()->GetLocaleName().value_or(L"");
- pValue->SetString(pIsolate, wsLocaleName.ToUTF8().AsStringView());
+ *pValue =
+ fxv8::NewStringHelper(pIsolate, wsLocaleName.ToUTF8().AsStringView());
}
void CJX_Subform::instanceManager(v8::Isolate* pIsolate,
- CFXJSE_Value* pValue,
+ v8::Local<v8::Value>* pValue,
bool bSetting,
XFA_Attribute eAttribute) {
if (bSetting) {
@@ -124,12 +126,9 @@
break;
}
}
- if (!pInstanceMgr) {
- pValue->SetNull(pIsolate);
- return;
- }
-
- pValue->ForceSetValue(
- pIsolate, GetDocument()->GetScriptContext()->GetOrCreateJSBindingFromMap(
- pInstanceMgr));
+ *pValue = pInstanceMgr ? GetDocument()
+ ->GetScriptContext()
+ ->GetOrCreateJSBindingFromMap(pInstanceMgr)
+ .As<v8::Value>()
+ : fxv8::NewNullHelper(pIsolate).As<v8::Value>();
}