From f743552fbdb17f974c9b1675af81210fe0ffcc50 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Mon, 5 Feb 2018 22:27:22 +0000 Subject: 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 Reviewed-by: Tom Sepez --- fxjs/cjs_console.cpp | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) (limited to 'fxjs/cjs_console.cpp') diff --git a/fxjs/cjs_console.cpp b/fxjs/cjs_console.cpp index 2b4dd27977..2b7c84ad78 100644 --- a/fxjs/cjs_console.cpp +++ b/fxjs/cjs_console.cpp @@ -19,38 +19,36 @@ const JSMethodSpec CJS_Console::MethodSpecs[] = {{"clear", clear_static}, {"show", show_static}}; int CJS_Console::ObjDefnID = -1; +const char CJS_Console::kName[] = "console"; // static void CJS_Console::DefineJSObjects(CFXJS_Engine* pEngine) { - ObjDefnID = pEngine->DefineObj("console", FXJSOBJTYPE_STATIC, + ObjDefnID = pEngine->DefineObj(CJS_Console::kName, FXJSOBJTYPE_STATIC, JSConstructor, JSDestructor); DefineMethods(pEngine, ObjDefnID, MethodSpecs, FX_ArraySize(MethodSpecs)); } -CJS_Console::CJS_Console(v8::Local pObject) : CJS_Object(pObject) { - m_pEmbedObj = pdfium::MakeUnique(this); -} - -console::console(CJS_Object* pJSObject) : CJS_EmbedObj(pJSObject) {} +CJS_Console::CJS_Console(v8::Local pObject) : CJS_Object(pObject) {} -console::~console() = default; +CJS_Console::~CJS_Console() = default; -CJS_Return console::clear(CJS_Runtime* pRuntime, - const std::vector>& params) { +CJS_Return CJS_Console::clear(CJS_Runtime* pRuntime, + const std::vector>& params) { return CJS_Return(true); } -CJS_Return console::hide(CJS_Runtime* pRuntime, - const std::vector>& params) { +CJS_Return CJS_Console::hide(CJS_Runtime* pRuntime, + const std::vector>& params) { return CJS_Return(true); } -CJS_Return console::println(CJS_Runtime* pRuntime, - const std::vector>& params) { +CJS_Return CJS_Console::println( + CJS_Runtime* pRuntime, + const std::vector>& params) { return CJS_Return(params.size() > 0); } -CJS_Return console::show(CJS_Runtime* pRuntime, - const std::vector>& params) { +CJS_Return CJS_Console::show(CJS_Runtime* pRuntime, + const std::vector>& params) { return CJS_Return(true); } -- cgit v1.2.3