From ef299534cce8cc42f1bd13665a75947c88195ce0 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Thu, 26 Oct 2017 16:48:30 -0400 Subject: Cleanup statics in JS classes This CL removes the static object IDs from each of the CJS_Object subclasses and moves them to anonymous namespaces. The Spec arrays are moved to private members of the object classes. Change-Id: I5dcdb87ef57e4b374b5431580fb55cb75023f8fb Reviewed-on: https://pdfium-review.googlesource.com/16950 Reviewed-by: Tom Sepez Commit-Queue: dsinclair --- fpdfsdk/javascript/console.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'fpdfsdk/javascript/console.h') diff --git a/fpdfsdk/javascript/console.h b/fpdfsdk/javascript/console.h index de1a40a30e..96c2daec21 100644 --- a/fpdfsdk/javascript/console.h +++ b/fpdfsdk/javascript/console.h @@ -29,18 +29,19 @@ class console : public CJS_EmbedObj { class CJS_Console : public CJS_Object { public: + static void DefineJSObjects(CFXJS_Engine* pEngine, FXJSOBJTYPE eObjType); + explicit CJS_Console(v8::Local pObject) : CJS_Object(pObject) {} ~CJS_Console() override {} - static int g_nObjDefnID; - static JSMethodSpec MethodSpecs[]; - - static void DefineJSObjects(CFXJS_Engine* pEngine, FXJSOBJTYPE eObjType); - JS_STATIC_METHOD(clear, console); JS_STATIC_METHOD(hide, console); JS_STATIC_METHOD(println, console); JS_STATIC_METHOD(show, console); + + private: + static int ObjDefnID; + static JSMethodSpec MethodSpecs[]; }; #endif // FPDFSDK_JAVASCRIPT_CONSOLE_H_ -- cgit v1.2.3