summaryrefslogtreecommitdiff
path: root/fxjs/cjs_icon.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2018-02-05 22:27:22 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-02-05 22:27:22 +0000
commitf743552fbdb17f974c9b1675af81210fe0ffcc50 (patch)
treed0eccefff3c758151428e18eb803e93d8864046a /fxjs/cjs_icon.cpp
parent998fee395fc8a543968c7db3db9e3cf81dee57fc (diff)
downloadpdfium-f743552fbdb17f974c9b1675af81210fe0ffcc50.tar.xz
Fold CJS_EmbedObj classes into CJS_Object classes
This CL removes the CJS_EmbedObj class and various subclasses and folds the subclasses into their CJS_Object counterparts. Change-Id: If6b882a4995c0b1bf83ac783f5c27ba9216c2d5c Reviewed-on: https://pdfium-review.googlesource.com/25410 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fxjs/cjs_icon.cpp')
-rw-r--r--fxjs/cjs_icon.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/fxjs/cjs_icon.cpp b/fxjs/cjs_icon.cpp
index 69a6d45557..40a2936d95 100644
--- a/fxjs/cjs_icon.cpp
+++ b/fxjs/cjs_icon.cpp
@@ -10,6 +10,7 @@ const JSPropertySpec CJS_Icon::PropertySpecs[] = {
{"name", get_name_static, set_name_static}};
int CJS_Icon::ObjDefnID = -1;
+const char CJS_Icon::kName[] = "Icon";
// static
int CJS_Icon::GetObjDefnID() {
@@ -18,24 +19,20 @@ int CJS_Icon::GetObjDefnID() {
// static
void CJS_Icon::DefineJSObjects(CFXJS_Engine* pEngine) {
- ObjDefnID = pEngine->DefineObj("Icon", FXJSOBJTYPE_DYNAMIC,
+ ObjDefnID = pEngine->DefineObj(CJS_Icon::kName, FXJSOBJTYPE_DYNAMIC,
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"") {}
+CJS_Icon::CJS_Icon(v8::Local<v8::Object> pObject)
+ : CJS_Object(pObject), m_swIconName(L"") {}
-Icon::~Icon() = default;
+CJS_Icon::~CJS_Icon() = default;
-CJS_Return Icon::get_name(CJS_Runtime* pRuntime) {
+CJS_Return CJS_Icon::get_name(CJS_Runtime* pRuntime) {
return CJS_Return(pRuntime->NewString(m_swIconName.c_str()));
}
-CJS_Return Icon::set_name(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp) {
+CJS_Return CJS_Icon::set_name(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp) {
return CJS_Return(false);
}