summaryrefslogtreecommitdiff
path: root/fxjs/JS_Define.h
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2018-02-05 22:27:22 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-02-05 22:27:22 +0000
commitf743552fbdb17f974c9b1675af81210fe0ffcc50 (patch)
treed0eccefff3c758151428e18eb803e93d8864046a /fxjs/JS_Define.h
parent998fee395fc8a543968c7db3db9e3cf81dee57fc (diff)
downloadpdfium-f743552fbdb17f974c9b1675af81210fe0ffcc50.tar.xz
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 <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fxjs/JS_Define.h')
-rw-r--r--fxjs/JS_Define.h20
1 files changed, 10 insertions, 10 deletions
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<C*>(pJSObj->GetEmbedObject());
+ C* pObj = static_cast<C*>(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<C*>(pJSObj->GetEmbedObject());
+ C* pObj = static_cast<C*>(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<C*>(pJSObj->GetEmbedObject());
+ C* pObj = static_cast<C*>(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<v8::String> property, \
const v8::PropertyCallbackInfo<v8::Value>& info) { \
JSPropGetter<class_name, &class_name::get_##prop_name>( \
- #err_name, #class_name, property, info); \
+ #err_name, class_name::kName, property, info); \
} \
static void set_##prop_name##_static( \
v8::Local<v8::String> property, v8::Local<v8::Value> value, \
const v8::PropertyCallbackInfo<void>& info) { \
JSPropSetter<class_name, &class_name::set_##prop_name>( \
- #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<v8::Value>& info) { \
- JSMethod<class_name, &class_name::method_name>(#method_name, #class_name, \
- info); \
+#define JS_STATIC_METHOD(method_name, class_name) \
+ static void method_name##_static( \
+ const v8::FunctionCallbackInfo<v8::Value>& info) { \
+ JSMethod<class_name, &class_name::method_name>(#method_name, \
+ class_name::kName, info); \
}
#endif // FXJS_JS_DEFINE_H_