diff options
author | Tom Sepez <tsepez@chromium.org> | 2017-02-16 17:01:00 -0800 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-02-21 15:18:27 +0000 |
commit | b1670b5cca9a59dfb612ef9eb891a70dd716bf9c (patch) | |
tree | e624b1ca93721894ff29a14bb52443bf4f952cf6 /fpdfsdk/javascript/global.h | |
parent | 026f3d306d339585612d63a9f6ac5ed8839a3179 (diff) | |
download | pdfium-b1670b5cca9a59dfb612ef9eb891a70dd716bf9c.tar.xz |
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 <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fpdfsdk/javascript/global.h')
-rw-r--r-- | fpdfsdk/javascript/global.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fpdfsdk/javascript/global.h b/fpdfsdk/javascript/global.h index cc5601cdeb..50dfcf3795 100644 --- a/fpdfsdk/javascript/global.h +++ b/fpdfsdk/javascript/global.h @@ -35,23 +35,23 @@ class JSGlobalAlternate : public CJS_EmbedObj { explicit JSGlobalAlternate(CJS_Object* pJSObject); ~JSGlobalAlternate() override; - bool setPersistent(IJS_EventContext* cc, + bool setPersistent(CJS_Runtime* pRuntime, const std::vector<CJS_Value>& params, CJS_Value& vRet, CFX_WideString& sError); bool QueryProperty(const FX_WCHAR* propname); - bool DoProperty(IJS_EventContext* cc, + bool DoProperty(CJS_Runtime* pRuntime, const FX_WCHAR* propname, CJS_PropValue& vp, CFX_WideString& sError); - bool DelProperty(IJS_EventContext* cc, + bool DelProperty(CJS_Runtime* pRuntime, const FX_WCHAR* propname, CFX_WideString& sError); void Initial(CPDFSDK_FormFillEnvironment* pFormFillEnv); private: void UpdateGlobalPersistentVariables(); - void CommitGlobalPersisitentVariables(IJS_EventContext* cc); + void CommitGlobalPersisitentVariables(CJS_Runtime* pRuntime); void DestroyGlobalPersisitentVariables(); bool SetGlobalVariables(const CFX_ByteString& propname, JS_GlobalDataType nType, @@ -60,7 +60,7 @@ class JSGlobalAlternate : public CJS_EmbedObj { const CFX_ByteString& sData, v8::Local<v8::Object> pData, bool bDefaultPersistent); - void ObjectToArray(IJS_EventContext* cc, + void ObjectToArray(CJS_Runtime* pRuntime, v8::Local<v8::Object> pObj, CJS_GlobalVariableArray& array); void PutObjectProperty(v8::Local<v8::Object> obj, CJS_KeyValue* pData); |