From b1670b5cca9a59dfb612ef9eb891a70dd716bf9c Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Thu, 16 Feb 2017 17:01:00 -0800 Subject: Pass CJS_Runtime to JS callbacks. This is much more convenient, since only a fraction of them need an IJS_EventContext, which can be obtained from the CJS_Runtime. Make GetCurrentEventContext() specific to CJS_Runtime, and return the concrete type. This saves a lot of casting. Change-Id: If79a3bcbf44de513f3caace153099234cc313d47 Reviewed-on: https://pdfium-review.googlesource.com/2793 Commit-Queue: dsinclair Reviewed-by: dsinclair --- fpdfsdk/javascript/color.h | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) (limited to 'fpdfsdk/javascript/color.h') diff --git a/fpdfsdk/javascript/color.h b/fpdfsdk/javascript/color.h index df53b4ab52..f966ca76d1 100644 --- a/fpdfsdk/javascript/color.h +++ b/fpdfsdk/javascript/color.h @@ -17,26 +17,28 @@ class color : public CJS_EmbedObj { explicit color(CJS_Object* pJSObject); ~color() override; - bool black(IJS_EventContext* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool blue(IJS_EventContext* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool cyan(IJS_EventContext* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool dkGray(IJS_EventContext* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool gray(IJS_EventContext* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool green(IJS_EventContext* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool ltGray(IJS_EventContext* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool magenta(IJS_EventContext* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool red(IJS_EventContext* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool transparent(IJS_EventContext* cc, + bool black(CJS_Runtime* pRuntime, CJS_PropValue& vp, CFX_WideString& sError); + bool blue(CJS_Runtime* pRuntime, CJS_PropValue& vp, CFX_WideString& sError); + bool cyan(CJS_Runtime* pRuntime, CJS_PropValue& vp, CFX_WideString& sError); + bool dkGray(CJS_Runtime* pRuntime, CJS_PropValue& vp, CFX_WideString& sError); + bool gray(CJS_Runtime* pRuntime, CJS_PropValue& vp, CFX_WideString& sError); + bool green(CJS_Runtime* pRuntime, CJS_PropValue& vp, CFX_WideString& sError); + bool ltGray(CJS_Runtime* pRuntime, CJS_PropValue& vp, CFX_WideString& sError); + bool magenta(CJS_Runtime* pRuntime, + CJS_PropValue& vp, + CFX_WideString& sError); + bool red(CJS_Runtime* pRuntime, CJS_PropValue& vp, CFX_WideString& sError); + bool transparent(CJS_Runtime* pRuntime, CJS_PropValue& vp, CFX_WideString& sError); - bool white(IJS_EventContext* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool yellow(IJS_EventContext* cc, CJS_PropValue& vp, CFX_WideString& sError); + bool white(CJS_Runtime* pRuntime, CJS_PropValue& vp, CFX_WideString& sError); + bool yellow(CJS_Runtime* pRuntime, CJS_PropValue& vp, CFX_WideString& sError); - bool convert(IJS_EventContext* cc, + bool convert(CJS_Runtime* pRuntime, const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); - bool equal(IJS_EventContext* cc, + bool equal(CJS_Runtime* pRuntime, const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); -- cgit v1.2.3