From 018935c9304bebf13fbad20b124d775ccae87fae Mon Sep 17 00:00:00 2001 From: tsepez Date: Fri, 15 Apr 2016 13:15:12 -0700 Subject: Pass WideStrings without narrowing to c_str in javascript/ Avoid string duplication when the caller already has one. Review URL: https://codereview.chromium.org/1883273003 --- fpdfsdk/jsapi/include/fxjs_v8.h | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) (limited to 'fpdfsdk/jsapi/include') diff --git a/fpdfsdk/jsapi/include/fxjs_v8.h b/fpdfsdk/jsapi/include/fxjs_v8.h index 34ff377d92..235f3bc902 100644 --- a/fpdfsdk/jsapi/include/fxjs_v8.h +++ b/fpdfsdk/jsapi/include/fxjs_v8.h @@ -229,50 +229,47 @@ void FXJS_SetPrivate(v8::Isolate* pIsolate, void* FXJS_GetPrivate(v8::Isolate* pIsolate, v8::Local pObj); void FXJS_FreePrivate(void* p); void FXJS_FreePrivate(v8::Local pObj); - void FXJS_Error(v8::Isolate* isolate, const CFX_WideString& message); -v8::Local FXJS_WSToJSString(v8::Isolate* pIsolate, - const wchar_t* PropertyName, - int Len = -1); +v8::Local FXJS_WSToJSString(v8::Isolate* pIsolate, + const CFX_WideString& wsPropertyName); v8::Local FXJS_GetObjectElement(v8::Isolate* pIsolate, v8::Local pObj, - const wchar_t* PropertyName); + const CFX_WideString& PropertyName); v8::Local FXJS_GetObjectElementNames(v8::Isolate* pIsolate, v8::Local pObj); - v8::Local FXJS_GetArrayElement(v8::Isolate* pIsolate, v8::Local pArray, unsigned index); -unsigned FXJS_GetArrayLength(v8::Local pArray); +unsigned FXJS_GetArrayLength(v8::Local pArray); void FXJS_PutObjectString(v8::Isolate* pIsolate, v8::Local pObj, - const wchar_t* PropertyName, - const wchar_t* sValue); + const CFX_WideString& wsPropertyName, + const CFX_WideString& wsValue); void FXJS_PutObjectNumber(v8::Isolate* pIsolate, v8::Local pObj, - const wchar_t* PropertyName, + const CFX_WideString& PropertyName, int nValue); void FXJS_PutObjectNumber(v8::Isolate* pIsolate, v8::Local pObj, - const wchar_t* PropertyName, + const CFX_WideString& PropertyName, float fValue); void FXJS_PutObjectNumber(v8::Isolate* pIsolate, v8::Local pObj, - const wchar_t* PropertyName, + const CFX_WideString& PropertyName, double dValue); void FXJS_PutObjectBoolean(v8::Isolate* pIsolate, v8::Local pObj, - const wchar_t* PropertyName, + const CFX_WideString& PropertyName, bool bValue); void FXJS_PutObjectObject(v8::Isolate* pIsolate, v8::Local pObj, - const wchar_t* PropertyName, + const CFX_WideString& PropertyName, v8::Local pPut); void FXJS_PutObjectNull(v8::Isolate* pIsolate, v8::Local pObj, - const wchar_t* PropertyName); + const CFX_WideString& PropertyName); unsigned FXJS_PutArrayElement(v8::Isolate* pIsolate, v8::Local pArray, unsigned index, -- cgit v1.2.3