1 // Copyright 2014 The PDFium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7 #include "fxjs/cjs_console.h"
8
9 #include "core/fxcrt/span.h"
10 #include "fxjs/cjs_event_context.h"
11 #include "fxjs/cjs_object.h"
12 #include "fxjs/js_define.h"
13
14 const JSMethodSpec CJS_Console::MethodSpecs[] = {{"clear", clear_static},
15 {"hide", hide_static},
16 {"println", println_static},
17 {"show", show_static}};
18
19 uint32_t CJS_Console::ObjDefnID = 0;
20 const char CJS_Console::kName[] = "console";
21
22 // static
GetObjDefnID()23 uint32_t CJS_Console::GetObjDefnID() {
24 return ObjDefnID;
25 }
26
27 // static
DefineJSObjects(CFXJS_Engine * pEngine)28 void CJS_Console::DefineJSObjects(CFXJS_Engine* pEngine) {
29 ObjDefnID = pEngine->DefineObj(CJS_Console::kName, FXJSOBJTYPE_STATIC,
30 JSConstructor<CJS_Console>, JSDestructor);
31 DefineMethods(pEngine, ObjDefnID, MethodSpecs);
32 }
33
CJS_Console(v8::Local<v8::Object> pObject,CJS_Runtime * pRuntime)34 CJS_Console::CJS_Console(v8::Local<v8::Object> pObject, CJS_Runtime* pRuntime)
35 : CJS_Object(pObject, pRuntime) {}
36
37 CJS_Console::~CJS_Console() = default;
38
clear(CJS_Runtime * pRuntime,pdfium::span<v8::Local<v8::Value>> params)39 CJS_Result CJS_Console::clear(CJS_Runtime* pRuntime,
40 pdfium::span<v8::Local<v8::Value>> params) {
41 return CJS_Result::Success();
42 }
43
hide(CJS_Runtime * pRuntime,pdfium::span<v8::Local<v8::Value>> params)44 CJS_Result CJS_Console::hide(CJS_Runtime* pRuntime,
45 pdfium::span<v8::Local<v8::Value>> params) {
46 return CJS_Result::Success();
47 }
48
println(CJS_Runtime * pRuntime,pdfium::span<v8::Local<v8::Value>> params)49 CJS_Result CJS_Console::println(CJS_Runtime* pRuntime,
50 pdfium::span<v8::Local<v8::Value>> params) {
51 return CJS_Result::Success();
52 }
53
show(CJS_Runtime * pRuntime,pdfium::span<v8::Local<v8::Value>> params)54 CJS_Result CJS_Console::show(CJS_Runtime* pRuntime,
55 pdfium::span<v8::Local<v8::Value>> params) {
56 return CJS_Result::Success();
57 }
58