From 2311b784fe85a0a1d78f78f0f05586059a63fa65 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Mon, 23 Feb 2015 10:22:51 -0800 Subject: Merge to XFA: Replace second set of #defines with templates in JS_Define.h Original Review URL: https://codereview.chromium.org/945623002 TBR=brucedawson@chromium.org Review URL: https://codereview.chromium.org/948083002 --- fpdfsdk/include/jsapi/fxjs_v8.h | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) (limited to 'fpdfsdk/include/jsapi') diff --git a/fpdfsdk/include/jsapi/fxjs_v8.h b/fpdfsdk/include/jsapi/fxjs_v8.h index e08196d6f1..b6ea60be13 100644 --- a/fpdfsdk/include/jsapi/fxjs_v8.h +++ b/fpdfsdk/include/jsapi/fxjs_v8.h @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef FXJSAPI_H @@ -30,8 +30,8 @@ enum FXJSVALUETYPE struct FXJSErr { - const wchar_t* message; - const wchar_t* srcline; + const wchar_t* message; + const wchar_t* srcline; unsigned linnum; }; @@ -41,23 +41,9 @@ typedef v8::Isolate IJS_Runtime; class IFXJS_Context; class IFXJS_Runtime; +typedef unsigned (*LP_CONSTRUCTOR)(IFXJS_Context* cc, v8::Handle obj, v8::Handle global); +typedef unsigned (*LP_DESTRUCTOR)(v8::Handle obj); -#ifndef JSCRIPT_ARGS -#define JSCRIPT_ARGS - -#define JS_CONSTRUCTOR_ARGS IFXJS_Context* cc, v8::Handle obj, v8::Handle global -#define JS_DESTRUCTOR_ARGS v8::Handle obj - -#define JS_PROPQUERY_ARGS v8::Local property,const v8::PropertyCallbackInfo& info -#define JS_NAMED_PROPGET_ARGS v8::Local property, const v8::PropertyCallbackInfo& info - -#define JS_NAMED_PROPPUT_ARGS v8::Local property,v8::Local value,const v8::PropertyCallbackInfo& info -#define JS_PROPDEL_ARGS v8::Local property,const v8::PropertyCallbackInfo& info - -typedef unsigned (*LP_CONSTRUCTOR)(JS_CONSTRUCTOR_ARGS); -typedef unsigned (*LP_DESTRUCTOR)(JS_DESTRUCTOR_ARGS); - -#endif int JS_DefineObj(IJS_Runtime* pJSRuntime, const wchar_t* sObjName, FXJSOBJTYPE eObjType, LP_CONSTRUCTOR pConstructor, LP_DESTRUCTOR pDestructor, unsigned bApplyNew); int JS_DefineObjMethod(IJS_Runtime* pJSRuntime, int nObjDefnID, const wchar_t* sMethodName, v8::FunctionCallback pMethodCall, unsigned nParamNum); @@ -69,7 +55,7 @@ int JS_DefineGlobalConst(IJS_Runtime* pJSRuntime, const wchar_t* sConstNa void JS_InitialRuntime(IJS_Runtime* pJSRuntime,IFXJS_Runtime* pFXRuntime, IFXJS_Context* context, v8::Persistent& v8PersistentContext); void JS_ReleaseRuntime(IJS_Runtime* pJSRuntime, v8::Persistent& v8PersistentContext); -void JS_Initial(); +void JS_Initial(); void JS_Release(); int JS_Parse(IJS_Runtime* pJSRuntime, IFXJS_Context* pJSContext, const wchar_t* script, long length, FXJSErr* perror); int JS_Execute(IJS_Runtime* pJSRuntime, IFXJS_Context* pJSContext, const wchar_t* script, long length, FXJSErr* perror); -- cgit v1.2.3