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/PublicMethods.h | 44 +++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'fpdfsdk/javascript/PublicMethods.h') diff --git a/fpdfsdk/javascript/PublicMethods.h b/fpdfsdk/javascript/PublicMethods.h index bb01ea33cb..060c74303a 100644 --- a/fpdfsdk/javascript/PublicMethods.h +++ b/fpdfsdk/javascript/PublicMethods.h @@ -18,91 +18,91 @@ class CJS_PublicMethods : public CJS_Object { : CJS_Object(pObject) {} ~CJS_PublicMethods() override {} - static bool AFNumber_Format(IJS_EventContext* cc, + static bool AFNumber_Format(CJS_Runtime* pRuntime, const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); - static bool AFNumber_Keystroke(IJS_EventContext* cc, + static bool AFNumber_Keystroke(CJS_Runtime* pRuntime, const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); - static bool AFPercent_Format(IJS_EventContext* cc, + static bool AFPercent_Format(CJS_Runtime* pRuntime, const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); - static bool AFPercent_Keystroke(IJS_EventContext* cc, + static bool AFPercent_Keystroke(CJS_Runtime* pRuntime, const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); - static bool AFDate_FormatEx(IJS_EventContext* cc, + static bool AFDate_FormatEx(CJS_Runtime* pRuntime, const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); - static bool AFDate_KeystrokeEx(IJS_EventContext* cc, + static bool AFDate_KeystrokeEx(CJS_Runtime* pRuntime, const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); - static bool AFDate_Format(IJS_EventContext* cc, + static bool AFDate_Format(CJS_Runtime* pRuntime, const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); - static bool AFDate_Keystroke(IJS_EventContext* cc, + static bool AFDate_Keystroke(CJS_Runtime* pRuntime, const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); - static bool AFTime_FormatEx(IJS_EventContext* cc, + static bool AFTime_FormatEx(CJS_Runtime* pRuntime, const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); // - static bool AFTime_KeystrokeEx(IJS_EventContext* cc, + static bool AFTime_KeystrokeEx(CJS_Runtime* pRuntime, const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); - static bool AFTime_Format(IJS_EventContext* cc, + static bool AFTime_Format(CJS_Runtime* pRuntime, const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); - static bool AFTime_Keystroke(IJS_EventContext* cc, + static bool AFTime_Keystroke(CJS_Runtime* pRuntime, const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); - static bool AFSpecial_Format(IJS_EventContext* cc, + static bool AFSpecial_Format(CJS_Runtime* pRuntime, const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); - static bool AFSpecial_Keystroke(IJS_EventContext* cc, + static bool AFSpecial_Keystroke(CJS_Runtime* pRuntime, const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); - static bool AFSpecial_KeystrokeEx(IJS_EventContext* cc, + static bool AFSpecial_KeystrokeEx(CJS_Runtime* pRuntime, const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); // - static bool AFSimple(IJS_EventContext* cc, + static bool AFSimple(CJS_Runtime* pRuntime, const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); - static bool AFMakeNumber(IJS_EventContext* cc, + static bool AFMakeNumber(CJS_Runtime* pRuntime, const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); - static bool AFSimple_Calculate(IJS_EventContext* cc, + static bool AFSimple_Calculate(CJS_Runtime* pRuntime, const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); - static bool AFRange_Validate(IJS_EventContext* cc, + static bool AFRange_Validate(CJS_Runtime* pRuntime, const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); - static bool AFMergeChange(IJS_EventContext* cc, + static bool AFMergeChange(CJS_Runtime* pRuntime, const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); - static bool AFParseDateEx(IJS_EventContext* cc, + static bool AFParseDateEx(CJS_Runtime* pRuntime, const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); - static bool AFExtractNums(IJS_EventContext* cc, + static bool AFExtractNums(CJS_Runtime* pRuntime, const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); -- cgit v1.2.3