From ce0f004523fdc098186bc453a85543c20b0059a7 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Tue, 23 Oct 2018 20:37:33 +0000 Subject: Remove CJS_Report class. Its methods are never registered with JavaScript, so they can't be called, and they don't do anything anyways. In fact, the signature of its DefineJSObjects() method is about 2 years out of date ... Change-Id: I028d43ff2c7fa5ab0f59c5790fee3fa91d2f20ac Reviewed-on: https://pdfium-review.googlesource.com/c/44533 Reviewed-by: Lei Zhang Commit-Queue: Tom Sepez --- fxjs/BUILD.gn | 2 -- fxjs/cjs_report.cpp | 49 ------------------------------------------------- fxjs/cjs_report.h | 37 ------------------------------------- fxjs/cjs_runtime.cpp | 1 - 4 files changed, 89 deletions(-) delete mode 100644 fxjs/cjs_report.cpp delete mode 100644 fxjs/cjs_report.h diff --git a/fxjs/BUILD.gn b/fxjs/BUILD.gn index 5f475edd7a..71551c3137 100644 --- a/fxjs/BUILD.gn +++ b/fxjs/BUILD.gn @@ -76,8 +76,6 @@ jumbo_source_set("fxjs") { "cjs_position.h", "cjs_publicmethods.cpp", "cjs_publicmethods.h", - "cjs_report.cpp", - "cjs_report.h", "cjs_result.cpp", "cjs_result.h", "cjs_runtime.cpp", diff --git a/fxjs/cjs_report.cpp b/fxjs/cjs_report.cpp deleted file mode 100644 index 1cebefe2cc..0000000000 --- a/fxjs/cjs_report.cpp +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2014 PDFium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com - -#include "fxjs/cjs_report.h" - -#include - -#include "fxjs/cjs_object.h" -#include "fxjs/js_define.h" - -const JSMethodSpec CJS_Report::MethodSpecs[] = { - {"save", save_static}, - {"writeText", writeText_static}}; - -int CJS_Report::ObjDefnID = -1; -const char CJS_Report::kName[] = "Report"; - -// static -int CJS_Report::GetObjDefnID() { - return ObjDefnID; -} - -// static -void CJS_Report::DefineJSObjects(CFXJS_Engine* pEngine, FXJSOBJTYPE eObjType) { - ObjDefnID = pEngine->DefineObj(CJS_Report::kName, eObjType, - JSConstructor, JSDestructor); - DefineMethods(pEngine, ObjDefnID, MethodSpecs); -} - -CJS_Report::CJS_Report(v8::Local pObject, CJS_Runtime* pRuntime) - : CJS_Object(pObject, pRuntime) {} - -CJS_Report::~CJS_Report() = default; - -CJS_Result CJS_Report::writeText( - CJS_Runtime* pRuntime, - const std::vector>& params) { - // Unsafe, not supported, but do not return error. - return CJS_Result::Success(); -} - -CJS_Result CJS_Report::save(CJS_Runtime* pRuntime, - const std::vector>& params) { - // Unsafe, not supported, but do not return error. - return CJS_Result::Success(); -} diff --git a/fxjs/cjs_report.h b/fxjs/cjs_report.h deleted file mode 100644 index 919664dd65..0000000000 --- a/fxjs/cjs_report.h +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2014 PDFium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com - -#ifndef FXJS_CJS_REPORT_H_ -#define FXJS_CJS_REPORT_H_ - -#include - -#include "fxjs/cjs_object.h" -#include "fxjs/js_define.h" - -class CJS_Report final : public CJS_Object { - public: - static int GetObjDefnID(); - static void DefineJSObjects(CFXJS_Engine* pEngine, FXJSOBJTYPE eObjType); - - CJS_Report(v8::Local pObject, CJS_Runtime* pRuntime); - ~CJS_Report() override; - - JS_STATIC_METHOD(save, CJS_Report); - JS_STATIC_METHOD(writeText, CJS_Report); - - private: - static int ObjDefnID; - static const char kName[]; - static const JSMethodSpec MethodSpecs[]; - - CJS_Result save(CJS_Runtime* pRuntime, - const std::vector>& params); - CJS_Result writeText(CJS_Runtime* pRuntime, - const std::vector>& params); -}; - -#endif // FXJS_CJS_REPORT_H_ diff --git a/fxjs/cjs_runtime.cpp b/fxjs/cjs_runtime.cpp index 3914b36715..5364571919 100644 --- a/fxjs/cjs_runtime.cpp +++ b/fxjs/cjs_runtime.cpp @@ -30,7 +30,6 @@ #include "fxjs/cjs_object.h" #include "fxjs/cjs_position.h" #include "fxjs/cjs_publicmethods.h" -#include "fxjs/cjs_report.h" #include "fxjs/cjs_scalehow.h" #include "fxjs/cjs_scalewhen.h" #include "fxjs/cjs_style.h" -- cgit v1.2.3