diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2018-02-05 21:43:19 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-02-05 21:43:19 +0000 |
commit | 998fee395fc8a543968c7db3db9e3cf81dee57fc (patch) | |
tree | c11024354ed996cee5cd5d463ab050e1e2c02d5d /fxjs/cjs_icon.cpp | |
parent | 0729be26d745e2ea713908eb9040e2be7c40c96b (diff) | |
download | pdfium-998fee395fc8a543968c7db3db9e3cf81dee57fc.tar.xz |
Remove the CJS_EmbedObj template param from JSConstructor.
Each of the CJS_Objects can create their CJS_EmbedObj's internally and
we don't need to do it though the JSConstructor. This also removes the
need for the SetEmbedObj method in CJS_Object.
Change-Id: Ib0535ad922b370634fd1e622a04860a96c4f2825
Reviewed-on: https://pdfium-review.googlesource.com/25370
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fxjs/cjs_icon.cpp')
-rw-r--r-- | fxjs/cjs_icon.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/fxjs/cjs_icon.cpp b/fxjs/cjs_icon.cpp index 9a4b73b2d6..69a6d45557 100644 --- a/fxjs/cjs_icon.cpp +++ b/fxjs/cjs_icon.cpp @@ -19,14 +19,18 @@ int CJS_Icon::GetObjDefnID() { // static void CJS_Icon::DefineJSObjects(CFXJS_Engine* pEngine) { ObjDefnID = pEngine->DefineObj("Icon", FXJSOBJTYPE_DYNAMIC, - JSConstructor<CJS_Icon, Icon>, JSDestructor); + JSConstructor<CJS_Icon>, JSDestructor); DefineProps(pEngine, ObjDefnID, PropertySpecs, FX_ArraySize(PropertySpecs)); } +CJS_Icon::CJS_Icon(v8::Local<v8::Object> pObject) : CJS_Object(pObject) { + m_pEmbedObj = pdfium::MakeUnique<Icon>(this); +} + Icon::Icon(CJS_Object* pJSObject) : CJS_EmbedObj(pJSObject), m_swIconName(L"") {} -Icon::~Icon() {} +Icon::~Icon() = default; CJS_Return Icon::get_name(CJS_Runtime* pRuntime) { return CJS_Return(pRuntime->NewString(m_swIconName.c_str())); |