diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2018-02-05 22:27:22 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-02-05 22:27:22 +0000 |
commit | f743552fbdb17f974c9b1675af81210fe0ffcc50 (patch) | |
tree | d0eccefff3c758151428e18eb803e93d8864046a /fxjs/cjs_console.cpp | |
parent | 998fee395fc8a543968c7db3db9e3cf81dee57fc (diff) | |
download | pdfium-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_console.cpp')
-rw-r--r-- | fxjs/cjs_console.cpp | 28 |
1 files changed, 13 insertions, 15 deletions
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<CJS_Console>, JSDestructor); DefineMethods(pEngine, ObjDefnID, MethodSpecs, FX_ArraySize(MethodSpecs)); } -CJS_Console::CJS_Console(v8::Local<v8::Object> pObject) : CJS_Object(pObject) { - m_pEmbedObj = pdfium::MakeUnique<console>(this); -} - -console::console(CJS_Object* pJSObject) : CJS_EmbedObj(pJSObject) {} +CJS_Console::CJS_Console(v8::Local<v8::Object> pObject) : CJS_Object(pObject) {} -console::~console() = default; +CJS_Console::~CJS_Console() = default; -CJS_Return console::clear(CJS_Runtime* pRuntime, - const std::vector<v8::Local<v8::Value>>& params) { +CJS_Return CJS_Console::clear(CJS_Runtime* pRuntime, + const std::vector<v8::Local<v8::Value>>& params) { return CJS_Return(true); } -CJS_Return console::hide(CJS_Runtime* pRuntime, - const std::vector<v8::Local<v8::Value>>& params) { +CJS_Return CJS_Console::hide(CJS_Runtime* pRuntime, + const std::vector<v8::Local<v8::Value>>& params) { return CJS_Return(true); } -CJS_Return console::println(CJS_Runtime* pRuntime, - const std::vector<v8::Local<v8::Value>>& params) { +CJS_Return CJS_Console::println( + CJS_Runtime* pRuntime, + const std::vector<v8::Local<v8::Value>>& params) { return CJS_Return(params.size() > 0); } -CJS_Return console::show(CJS_Runtime* pRuntime, - const std::vector<v8::Local<v8::Value>>& params) { +CJS_Return CJS_Console::show(CJS_Runtime* pRuntime, + const std::vector<v8::Local<v8::Value>>& params) { return CJS_Return(true); } |