diff options
author | Tom Sepez <tsepez@chromium.org> | 2018-02-05 18:52:09 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-02-05 18:52:09 +0000 |
commit | 57e097750846bf3ffc3e4e2ef9e78be8a82c69de (patch) | |
tree | 080a0d644b816cc6d2cb0b00f4c9629020894316 /fxjs/fxjs_v8.h | |
parent | 13c4d1b46641fb3041800cad3032e7e60026e3f4 (diff) | |
download | pdfium-57e097750846bf3ffc3e4e2ef9e78be8a82c69de.tar.xz |
Use unique pointer in CFXJS_PerObjectData.
Also use the actual type information, not void* and remove casts.
Template function not required to wrap virtual dtors.
Change-Id: I9397cae136c3c395a368a1ef0ce8162d9b586076
Reviewed-on: https://pdfium-review.googlesource.com/25290
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fxjs/fxjs_v8.h')
-rw-r--r-- | fxjs/fxjs_v8.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/fxjs/fxjs_v8.h b/fxjs/fxjs_v8.h index 4e6b248b5e..7091b0e43e 100644 --- a/fxjs/fxjs_v8.h +++ b/fxjs/fxjs_v8.h @@ -29,6 +29,7 @@ class CFXJSE_RuntimeData; #endif // PDF_ENABLE_XFA class CFXJS_ObjDefinition; +class CJS_Object; // FXJS_V8 places no restrictions on this class; it merely passes it // on to caller-provided methods. @@ -178,9 +179,10 @@ class CFXJS_Engine : public CJS_V8 { v8::Local<v8::Object> NewFxDynamicObj(int nObjDefnID, bool bStatic = false); // Native object binding. - void SetObjectPrivate(v8::Local<v8::Object> pObj, void* p); - void* GetObjectPrivate(v8::Local<v8::Object> pObj); - static void FreeObjectPrivate(void* p); + void SetObjectPrivate(v8::Local<v8::Object> pObj, + std::unique_ptr<CJS_Object> p); + CJS_Object* GetObjectPrivate(v8::Local<v8::Object> pObj); + static void FreeObjectPrivate(void* pPerObjectData); static void FreeObjectPrivate(v8::Local<v8::Object> pObj); void Error(const WideString& message); |