From f743552fbdb17f974c9b1675af81210fe0ffcc50 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Mon, 5 Feb 2018 22:27:22 +0000 Subject: 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 Reviewed-by: Tom Sepez --- fxjs/JS_Define.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'fxjs/JS_Define.h') diff --git a/fxjs/JS_Define.h b/fxjs/JS_Define.h index 540746afd5..61ad9efc1f 100644 --- a/fxjs/JS_Define.h +++ b/fxjs/JS_Define.h @@ -72,7 +72,7 @@ void JSPropGetter(const char* prop_name_string, if (!pJSObj) return; - C* pObj = reinterpret_cast(pJSObj->GetEmbedObject()); + C* pObj = static_cast(pJSObj); CJS_Return result = (pObj->*M)(pRuntime); if (result.HasError()) { pRuntime->Error(JSFormatErrorString(class_name_string, prop_name_string, @@ -99,7 +99,7 @@ void JSPropSetter(const char* prop_name_string, if (!pJSObj) return; - C* pObj = reinterpret_cast(pJSObj->GetEmbedObject()); + C* pObj = static_cast(pJSObj); CJS_Return result = (pObj->*M)(pRuntime, value); if (result.HasError()) { pRuntime->Error(JSFormatErrorString(class_name_string, prop_name_string, @@ -126,7 +126,7 @@ void JSMethod(const char* method_name_string, for (unsigned int i = 0; i < (unsigned int)info.Length(); i++) parameters.push_back(info[i]); - C* pObj = reinterpret_cast(pJSObj->GetEmbedObject()); + C* pObj = static_cast(pJSObj); CJS_Return result = (pObj->*M)(pRuntime, parameters); if (result.HasError()) { pRuntime->Error(JSFormatErrorString(class_name_string, method_name_string, @@ -143,20 +143,20 @@ void JSMethod(const char* method_name_string, v8::Local property, \ const v8::PropertyCallbackInfo& info) { \ JSPropGetter( \ - #err_name, #class_name, property, info); \ + #err_name, class_name::kName, property, info); \ } \ static void set_##prop_name##_static( \ v8::Local property, v8::Local value, \ const v8::PropertyCallbackInfo& info) { \ JSPropSetter( \ - #err_name, #class_name, property, value, info); \ + #err_name, class_name::kName, property, value, info); \ } -#define JS_STATIC_METHOD(method_name, class_name) \ - static void method_name##_static( \ - const v8::FunctionCallbackInfo& info) { \ - JSMethod(#method_name, #class_name, \ - info); \ +#define JS_STATIC_METHOD(method_name, class_name) \ + static void method_name##_static( \ + const v8::FunctionCallbackInfo& info) { \ + JSMethod(#method_name, \ + class_name::kName, info); \ } #endif // FXJS_JS_DEFINE_H_ -- cgit v1.2.3