summaryrefslogtreecommitdiff
path: root/xfa/src/fxjse
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/src/fxjse')
-rw-r--r--xfa/src/fxjse/src/class.cpp4
-rw-r--r--xfa/src/fxjse/src/class.h2
-rw-r--r--xfa/src/fxjse/src/dynprop.cpp8
-rw-r--r--xfa/src/fxjse/src/value.cpp24
-rw-r--r--xfa/src/fxjse/src/value.h12
5 files changed, 25 insertions, 25 deletions
diff --git a/xfa/src/fxjse/src/class.cpp b/xfa/src/fxjse/src/class.cpp
index 42db877fc9..bc02e8b0ff 100644
--- a/xfa/src/fxjse/src/class.cpp
+++ b/xfa/src/fxjse/src/class.cpp
@@ -34,7 +34,7 @@ FXJSE_HCLASS FXJSE_DefineClass(FXJSE_HCONTEXT hContext, const FXJSE_CLASS* lpCla
ASSERT(lpContext);
return reinterpret_cast<FXJSE_HCLASS>(CFXJSE_Class::Create(lpContext, lpClass, FALSE));
}
-FXJSE_HCLASS FXJSE_GetClass(FXJSE_HCONTEXT hContext, FX_BSTR szName)
+FXJSE_HCLASS FXJSE_GetClass(FXJSE_HCONTEXT hContext, const CFX_ByteStringC& szName)
{
return reinterpret_cast<FXJSE_HCLASS>(CFXJSE_Class::GetClassFromContext(reinterpret_cast<CFXJSE_Context*>(hContext), szName));
}
@@ -256,7 +256,7 @@ CFXJSE_Class* CFXJSE_Class::Create(CFXJSE_Context* lpContext, const FXJSE_CLASS*
lpContext->m_rgClasses.Add(pClass);
return pClass;
}
-CFXJSE_Class* CFXJSE_Class::GetClassFromContext(CFXJSE_Context* pContext, FX_BSTR szName)
+CFXJSE_Class* CFXJSE_Class::GetClassFromContext(CFXJSE_Context* pContext, const CFX_ByteStringC& szName)
{
for(int count = pContext->m_rgClasses.GetSize(), i = 0; i < count; i++) {
CFXJSE_Class* pClass = pContext->m_rgClasses[i];
diff --git a/xfa/src/fxjse/src/class.h b/xfa/src/fxjse/src/class.h
index f8cdc34022..309978e423 100644
--- a/xfa/src/fxjse/src/class.h
+++ b/xfa/src/fxjse/src/class.h
@@ -23,7 +23,7 @@ public:
}
public:
static CFXJSE_Class* Create(CFXJSE_Context* pContext, const FXJSE_CLASS* lpClassDefintion, FX_BOOL bIsJSGlobal = FALSE);
- static CFXJSE_Class* GetClassFromContext(CFXJSE_Context* pContext, FX_BSTR szName);
+ static CFXJSE_Class* GetClassFromContext(CFXJSE_Context* pContext, const CFX_ByteStringC& szName);
static void SetUpDynPropHandler(CFXJSE_Context* pContext, CFXJSE_Value* pValue, const FXJSE_CLASS* lpClassDefinition);
static void SetUpNamedPropHandler(v8::Isolate* pIsolate, v8::Local<v8::ObjectTemplate>& hObjectTemplate, const FXJSE_CLASS* lpClassDefinition);
protected:
diff --git a/xfa/src/fxjse/src/dynprop.cpp b/xfa/src/fxjse/src/dynprop.cpp
index 7c78f6f90a..840bd5f9a2 100644
--- a/xfa/src/fxjse/src/dynprop.cpp
+++ b/xfa/src/fxjse/src/dynprop.cpp
@@ -29,7 +29,7 @@ static void FXJSE_DynPropGetterAdapter_MethodCallback (const v8::FunctionCallbac
delete lpThisValue;
lpThisValue = NULL;
}
-static void FXJSE_DynPropGetterAdapter (const FXJSE_CLASS* lpClass, FXJSE_HOBJECT hObject, FX_BSTR szPropName, FXJSE_HVALUE hValue)
+static void FXJSE_DynPropGetterAdapter (const FXJSE_CLASS* lpClass, FXJSE_HOBJECT hObject, const CFX_ByteStringC& szPropName, FXJSE_HVALUE hValue)
{
ASSERT(lpClass);
int32_t nPropType = lpClass->dynPropTypeGetter == NULL ? FXJSE_ClassPropType_Property : lpClass->dynPropTypeGetter(hObject, szPropName, FALSE);
@@ -51,7 +51,7 @@ static void FXJSE_DynPropGetterAdapter (const FXJSE_CLASS* lpClass, FXJSE_HO
}
}
}
-static void FXJSE_DynPropSetterAdapter (const FXJSE_CLASS* lpClass, FXJSE_HOBJECT hObject, FX_BSTR szPropName, FXJSE_HVALUE hValue)
+static void FXJSE_DynPropSetterAdapter (const FXJSE_CLASS* lpClass, FXJSE_HOBJECT hObject, const CFX_ByteStringC& szPropName, FXJSE_HVALUE hValue)
{
ASSERT(lpClass);
int32_t nPropType = lpClass->dynPropTypeGetter == NULL ? FXJSE_ClassPropType_Property : lpClass->dynPropTypeGetter(hObject, szPropName, FALSE);
@@ -61,13 +61,13 @@ static void FXJSE_DynPropSetterAdapter (const FXJSE_CLASS* lpClass, FXJSE_HO
}
}
}
-static FX_BOOL FXJSE_DynPropQueryAdapter (const FXJSE_CLASS* lpClass, FXJSE_HOBJECT hObject, FX_BSTR szPropName)
+static FX_BOOL FXJSE_DynPropQueryAdapter (const FXJSE_CLASS* lpClass, FXJSE_HOBJECT hObject, const CFX_ByteStringC& szPropName)
{
ASSERT(lpClass);
int32_t nPropType = lpClass->dynPropTypeGetter == NULL ? FXJSE_ClassPropType_Property : lpClass->dynPropTypeGetter(hObject, szPropName, TRUE);
return nPropType != FXJSE_ClassPropType_None;
}
-static FX_BOOL FXJSE_DynPropDeleterAdapter (const FXJSE_CLASS* lpClass, FXJSE_HOBJECT hObject, FX_BSTR szPropName)
+static FX_BOOL FXJSE_DynPropDeleterAdapter (const FXJSE_CLASS* lpClass, FXJSE_HOBJECT hObject, const CFX_ByteStringC& szPropName)
{
ASSERT(lpClass);
int32_t nPropType = lpClass->dynPropTypeGetter == NULL ? FXJSE_ClassPropType_Property : lpClass->dynPropTypeGetter(hObject, szPropName, FALSE);
diff --git a/xfa/src/fxjse/src/value.cpp b/xfa/src/fxjse/src/value.cpp
index 8b5b5feb92..27674ffc4c 100644
--- a/xfa/src/fxjse/src/value.cpp
+++ b/xfa/src/fxjse/src/value.cpp
@@ -115,7 +115,7 @@ void FXJSE_Value_SetBoolean (FXJSE_HVALUE hValue, FX_BOOL bBoolean)
ASSERT(lpValue);
return lpValue->SetBoolean(bBoolean);
}
-void FXJSE_Value_SetUTF8String (FXJSE_HVALUE hValue, FX_BSTR szString)
+void FXJSE_Value_SetUTF8String (FXJSE_HVALUE hValue, const CFX_ByteStringC& szString)
{
CFXJSE_Value* lpValue = reinterpret_cast<CFXJSE_Value*>(hValue);
ASSERT(lpValue);
@@ -167,14 +167,14 @@ void FXJSE_Value_Set (FXJSE_HVALUE hValue, FXJSE_HVALUE hOriginalValue)
ASSERT(lpValue && lpOriginalValue);
return lpValue->Assign(lpOriginalValue);
}
-FX_BOOL FXJSE_Value_GetObjectProp (FXJSE_HVALUE hValue, FX_BSTR szPropName, FXJSE_HVALUE hPropValue)
+FX_BOOL FXJSE_Value_GetObjectProp (FXJSE_HVALUE hValue, const CFX_ByteStringC& szPropName, FXJSE_HVALUE hPropValue)
{
CFXJSE_Value* lpValue = reinterpret_cast<CFXJSE_Value*>(hValue);
CFXJSE_Value* lpPropValue = reinterpret_cast<CFXJSE_Value*>(hPropValue);
ASSERT(lpValue && lpPropValue);
return lpValue->GetObjectProperty(szPropName, lpPropValue);
}
-FX_BOOL FXJSE_Value_SetObjectProp (FXJSE_HVALUE hValue, FX_BSTR szPropName, FXJSE_HVALUE hPropValue)
+FX_BOOL FXJSE_Value_SetObjectProp (FXJSE_HVALUE hValue, const CFX_ByteStringC& szPropName, FXJSE_HVALUE hPropValue)
{
CFXJSE_Value* lpValue = reinterpret_cast<CFXJSE_Value*>(hValue);
CFXJSE_Value* lpPropValue = reinterpret_cast<CFXJSE_Value*>(hPropValue);
@@ -195,19 +195,19 @@ FX_BOOL FXJSE_Value_SetObjectPropByIdx (FXJSE_HVALUE hValue, uint32_t uPropIdx,
ASSERT(lpValue && lpPropValue);
return lpValue->SetObjectProperty(uPropIdx, lpPropValue);
}
-FX_BOOL FXJSE_Value_DeleteObjectProp (FXJSE_HVALUE hValue, FX_BSTR szPropName)
+FX_BOOL FXJSE_Value_DeleteObjectProp (FXJSE_HVALUE hValue, const CFX_ByteStringC& szPropName)
{
CFXJSE_Value* lpValue = reinterpret_cast<CFXJSE_Value*>(hValue);
ASSERT(lpValue);
return lpValue->DeleteObjectProperty(szPropName);
}
-FX_BOOL FXJSE_Value_ObjectHasOwnProp (FXJSE_HVALUE hValue, FX_BSTR szPropName, FX_BOOL bUseTypeGetter)
+FX_BOOL FXJSE_Value_ObjectHasOwnProp (FXJSE_HVALUE hValue, const CFX_ByteStringC& szPropName, FX_BOOL bUseTypeGetter)
{
CFXJSE_Value* lpValue = reinterpret_cast<CFXJSE_Value*>(hValue);
ASSERT(lpValue);
return lpValue->HasObjectOwnProperty(szPropName, bUseTypeGetter);
}
-FX_BOOL FXJSE_Value_SetObjectOwnProp (FXJSE_HVALUE hValue, FX_BSTR szPropName, FXJSE_HVALUE hPropValue)
+FX_BOOL FXJSE_Value_SetObjectOwnProp (FXJSE_HVALUE hValue, const CFX_ByteStringC& szPropName, FXJSE_HVALUE hPropValue)
{
CFXJSE_Value* lpValue = reinterpret_cast<CFXJSE_Value*>(hValue);
CFXJSE_Value* lpPropValue = reinterpret_cast<CFXJSE_Value*>(hPropValue);
@@ -249,7 +249,7 @@ FXJSE_HRUNTIME FXJSE_Value_GetRuntime(FXJSE_HVALUE hValue)
ASSERT(lpValue);
return reinterpret_cast<FXJSE_HRUNTIME>(lpValue->GetIsolate());
}
-void FXJSE_ThrowMessage(FX_BSTR utf8Name, FX_BSTR utf8Message)
+void FXJSE_ThrowMessage(const CFX_ByteStringC& utf8Name, const CFX_ByteStringC& utf8Message)
{
v8::Isolate* pIsolate = v8::Isolate::GetCurrent();
ASSERT(pIsolate);
@@ -358,7 +358,7 @@ void CFXJSE_Value::SetDate(FXJSE_DOUBLE dDouble)
v8::Local<v8::Value> hDate = v8::Date::New(m_pIsolate, dDouble);
m_hValue.Reset(m_pIsolate, hDate);
}
-FX_BOOL CFXJSE_Value::SetObjectProperty(FX_BSTR szPropName, CFXJSE_Value* lpPropValue)
+FX_BOOL CFXJSE_Value::SetObjectProperty(const CFX_ByteStringC& szPropName, CFXJSE_Value* lpPropValue)
{
CFXJSE_ScopeUtil_IsolateHandleRootContext scope(m_pIsolate);
v8::Local<v8::Value> hObject = v8::Local<v8::Value>::New(m_pIsolate, m_hValue);
@@ -368,7 +368,7 @@ FX_BOOL CFXJSE_Value::SetObjectProperty(FX_BSTR szPropName, CFXJSE_Value* lpProp
v8::Local<v8::Value> hPropValue = v8::Local<v8::Value>::New(m_pIsolate, lpPropValue->DirectGetValue());
return (FX_BOOL)hObject.As<v8::Object>()->Set(v8::String::NewFromUtf8(m_pIsolate, szPropName.GetCStr(), v8::String::kNormalString, szPropName.GetLength()), hPropValue);
}
-FX_BOOL CFXJSE_Value::GetObjectProperty(FX_BSTR szPropName, CFXJSE_Value* lpPropValue)
+FX_BOOL CFXJSE_Value::GetObjectProperty(const CFX_ByteStringC& szPropName, CFXJSE_Value* lpPropValue)
{
CFXJSE_ScopeUtil_IsolateHandleRootContext scope(m_pIsolate);
v8::Local<v8::Value> hObject = v8::Local<v8::Value>::New(m_pIsolate, m_hValue);
@@ -400,7 +400,7 @@ FX_BOOL CFXJSE_Value::GetObjectProperty(uint32_t uPropIdx, CFXJSE_Value* lpPropV
lpPropValue->ForceSetValue(hPropValue);
return TRUE;
}
-FX_BOOL CFXJSE_Value::DeleteObjectProperty(FX_BSTR szPropName)
+FX_BOOL CFXJSE_Value::DeleteObjectProperty(const CFX_ByteStringC& szPropName)
{
CFXJSE_ScopeUtil_IsolateHandleRootContext scope(m_pIsolate);
v8::Local<v8::Value> hObject = v8::Local<v8::Value>::New(m_pIsolate, m_hValue);
@@ -410,7 +410,7 @@ FX_BOOL CFXJSE_Value::DeleteObjectProperty(FX_BSTR szPropName)
hObject.As<v8::Object>()->Delete(v8::String::NewFromUtf8(m_pIsolate, szPropName.GetCStr(), v8::String::kNormalString, szPropName.GetLength()));
return TRUE;
}
-FX_BOOL CFXJSE_Value::HasObjectOwnProperty(FX_BSTR szPropName, FX_BOOL bUseTypeGetter)
+FX_BOOL CFXJSE_Value::HasObjectOwnProperty(const CFX_ByteStringC& szPropName, FX_BOOL bUseTypeGetter)
{
CFXJSE_ScopeUtil_IsolateHandleRootContext scope(m_pIsolate);
v8::Local<v8::Value> hObject = v8::Local<v8::Value>::New(m_pIsolate, m_hValue);
@@ -420,7 +420,7 @@ FX_BOOL CFXJSE_Value::HasObjectOwnProperty(FX_BSTR szPropName, FX_BOOL bUseTyp
v8::Local<v8::String> hKey = v8::String::NewFromUtf8(m_pIsolate, szPropName.GetCStr(), v8::String::kNormalString, szPropName.GetLength());
return hObject.As<v8::Object>()->HasRealNamedProperty(hKey) || (bUseTypeGetter && hObject.As<v8::Object>()->HasOwnProperty(hKey));
}
-FX_BOOL CFXJSE_Value::SetObjectOwnProperty(FX_BSTR szPropName, CFXJSE_Value* lpPropValue)
+FX_BOOL CFXJSE_Value::SetObjectOwnProperty(const CFX_ByteStringC& szPropName, CFXJSE_Value* lpPropValue)
{
CFXJSE_ScopeUtil_IsolateHandleRootContext scope(m_pIsolate);
v8::Local<v8::Value> hObject = v8::Local<v8::Value>::New(m_pIsolate, m_hValue);
diff --git a/xfa/src/fxjse/src/value.h b/xfa/src/fxjse/src/value.h
index db8a4faa95..0cebbdfec9 100644
--- a/xfa/src/fxjse/src/value.h
+++ b/xfa/src/fxjse/src/value.h
@@ -176,7 +176,7 @@ public:
v8::Local<v8::Value> hValue = v8::Number::New(m_pIsolate, dDouble);
m_hValue.Reset(m_pIsolate, hValue);
}
- V8_INLINE void SetString(FX_BSTR szString)
+ V8_INLINE void SetString(const CFX_ByteStringC& szString)
{
CFXJSE_ScopeUtil_IsolateHandle scope(m_pIsolate);
v8::Local<v8::Value> hValue = v8::String::NewFromUtf8(m_pIsolate,
@@ -195,13 +195,13 @@ public:
void SetArray(uint32_t uValueCount, CFXJSE_Value** rgValues);
void SetDate(FXJSE_DOUBLE dDouble);
public:
- FX_BOOL GetObjectProperty(FX_BSTR szPropName, CFXJSE_Value* lpPropValue);
- FX_BOOL SetObjectProperty(FX_BSTR szPropName, CFXJSE_Value* lpPropValue);
+ FX_BOOL GetObjectProperty(const CFX_ByteStringC& szPropName, CFXJSE_Value* lpPropValue);
+ FX_BOOL SetObjectProperty(const CFX_ByteStringC& szPropName, CFXJSE_Value* lpPropValue);
FX_BOOL GetObjectProperty(uint32_t uPropIdx, CFXJSE_Value* lpPropValue);
FX_BOOL SetObjectProperty(uint32_t uPropIdx, CFXJSE_Value* lpPropValue);
- FX_BOOL DeleteObjectProperty(FX_BSTR szPropName);
- FX_BOOL HasObjectOwnProperty(FX_BSTR szPropName, FX_BOOL bUseTypeGetter);
- FX_BOOL SetObjectOwnProperty(FX_BSTR szPropName, CFXJSE_Value* lpPropValue);
+ FX_BOOL DeleteObjectProperty(const CFX_ByteStringC& szPropName);
+ FX_BOOL HasObjectOwnProperty(const CFX_ByteStringC& szPropName, FX_BOOL bUseTypeGetter);
+ FX_BOOL SetObjectOwnProperty(const CFX_ByteStringC& szPropName, CFXJSE_Value* lpPropValue);
FX_BOOL SetFunctionBind(CFXJSE_Value* lpOldFunction, CFXJSE_Value* lpNewThis);
FX_BOOL Call(CFXJSE_Value* lpReceiver, CFXJSE_Value* lpRetValue, uint32_t nArgCount, FXJSE_HVALUE* lpArgs);
public: