blob: 043a68e09ef2a5cffb6b0d5b93a22dcedc01da01 [file] [log] [blame]
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001// Copyright 2014 PDFium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
Tom Sepezc6ab1722015-02-05 15:27:25 -08004
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07005// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
Dan Sinclairf766ad22016-03-14 13:51:24 -04007#include "fpdfsdk/javascript/report.h"
Tom Sepez37458412015-10-06 11:33:46 -07008
Dan Sinclair3ebd1212016-03-09 09:59:23 -05009#include <vector>
10
Dan Sinclairf766ad22016-03-14 13:51:24 -040011#include "fpdfsdk/javascript/JS_Define.h"
12#include "fpdfsdk/javascript/JS_Object.h"
13#include "fpdfsdk/javascript/JS_Value.h"
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070014
Tom Sepez04557b82017-02-16 09:43:10 -080015JSConstSpec CJS_Report::ConstSpecs[] = {{0, JSConstSpec::Number, 0, 0}};
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070016
Tom Sepez04557b82017-02-16 09:43:10 -080017JSPropertySpec CJS_Report::PropertySpecs[] = {{0, 0, 0}};
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070018
Tom Sepez9b99b632017-02-21 15:05:57 -080019JSMethodSpec CJS_Report::MethodSpecs[] = {{"save", save_static},
20 {"writeText", writeText_static},
Tom Sepez04557b82017-02-16 09:43:10 -080021 {0, 0}};
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070022
Dan Sinclair4b172c42017-10-23 11:22:31 -040023IMPLEMENT_JS_CLASS(CJS_Report, Report, Report)
Tom Sepezc6ab1722015-02-05 15:27:25 -080024
Nico Weber9d8ec5a2015-08-04 13:00:21 -070025Report::Report(CJS_Object* pJSObject) : CJS_EmbedObj(pJSObject) {}
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070026
Nico Weber9d8ec5a2015-08-04 13:00:21 -070027Report::~Report() {}
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070028
Dan Sinclair8f524d62017-10-25 13:30:31 -040029CJS_Return Report::writeText(CJS_Runtime* pRuntime,
30 const std::vector<v8::Local<v8::Value>>& params) {
Tom Sepezc6ab1722015-02-05 15:27:25 -080031 // Unsafe, not supported.
Dan Sinclair8f524d62017-10-25 13:30:31 -040032 return CJS_Return(true);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070033}
34
Dan Sinclair8f524d62017-10-25 13:30:31 -040035CJS_Return Report::save(CJS_Runtime* pRuntime,
36 const std::vector<v8::Local<v8::Value>>& params) {
Tom Sepezc6ab1722015-02-05 15:27:25 -080037 // Unsafe, not supported.
Dan Sinclair8f524d62017-10-25 13:30:31 -040038 return CJS_Return(true);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070039}