From d6ae2afa821c87e84790d5c04bbc172a7b12f08f Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Thu, 16 Feb 2017 11:49:55 -0800 Subject: Rename IJS_Context to IJS_EventContext. Prevents confusion with v8::Context, which is wrapped by a different IJS_ class. Change-Id: Iff75809e65015c0f810294de1f0d8ecf963150a3 Reviewed-on: https://pdfium-review.googlesource.com/2751 Commit-Queue: Tom Sepez Reviewed-by: dsinclair --- fpdfsdk/javascript/JS_Define.h | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'fpdfsdk/javascript/JS_Define.h') diff --git a/fpdfsdk/javascript/JS_Define.h b/fpdfsdk/javascript/JS_Define.h index feab4d1996..957f6836fc 100644 --- a/fpdfsdk/javascript/JS_Define.h +++ b/fpdfsdk/javascript/JS_Define.h @@ -70,7 +70,8 @@ struct JSMethodSpec { } \ ; // NOLINT -template +template void JSPropGetter(const char* prop_name_string, const char* class_name_string, v8::Local property, @@ -85,7 +86,7 @@ void JSPropGetter(const char* prop_name_string, CFX_WideString sError; CJS_PropValue value(pRuntime); value.StartGetting(); - if (!(pObj->*M)(pRuntime->GetCurrentContext(), value, sError)) { + if (!(pObj->*M)(pRuntime->GetCurrentEventContext(), value, sError)) { pRuntime->Error( JSFormatErrorString(class_name_string, prop_name_string, sError)); return; @@ -93,7 +94,8 @@ void JSPropGetter(const char* prop_name_string, info.GetReturnValue().Set(value.GetJSValue()->ToV8Value(pRuntime)); } -template +template void JSPropSetter(const char* prop_name_string, const char* class_name_string, v8::Local property, @@ -109,7 +111,7 @@ void JSPropSetter(const char* prop_name_string, CFX_WideString sError; CJS_PropValue propValue(pRuntime, CJS_Value(pRuntime, value)); propValue.StartSetting(); - if (!(pObj->*M)(pRuntime->GetCurrentContext(), propValue, sError)) { + if (!(pObj->*M)(pRuntime->GetCurrentEventContext(), propValue, sError)) { pRuntime->Error( JSFormatErrorString(class_name_string, prop_name_string, sError)); } @@ -130,7 +132,7 @@ void JSPropSetter(const char* prop_name_string, } template &, CJS_Value&, CFX_WideString&)> @@ -150,7 +152,7 @@ void JSMethod(const char* method_name_string, C* pObj = reinterpret_cast(pJSObj->GetEmbedObject()); CFX_WideString sError; CJS_Value valueRes(pRuntime); - if (!(pObj->*M)(pRuntime->GetCurrentContext(), parameters, valueRes, + if (!(pObj->*M)(pRuntime->GetCurrentEventContext(), parameters, valueRes, sError)) { pRuntime->Error( JSFormatErrorString(class_name_string, method_name_string, sError)); @@ -375,8 +377,8 @@ void JSSpecialPropGet(const char* class_name, CFX_WideString sError; CJS_PropValue value(pRuntime); value.StartGetting(); - if (!pObj->DoProperty(pRuntime->GetCurrentContext(), propname.c_str(), value, - sError)) { + if (!pObj->DoProperty(pRuntime->GetCurrentEventContext(), propname.c_str(), + value, sError)) { pRuntime->Error(JSFormatErrorString(class_name, "GetProperty", sError)); return; } @@ -401,7 +403,7 @@ void JSSpecialPropPut(const char* class_name, CFX_WideString sError; CJS_PropValue PropValue(pRuntime, CJS_Value(pRuntime, value)); PropValue.StartSetting(); - if (!pObj->DoProperty(pRuntime->GetCurrentContext(), propname.c_str(), + if (!pObj->DoProperty(pRuntime->GetCurrentEventContext(), propname.c_str(), PropValue, sError)) { pRuntime->Error(JSFormatErrorString(class_name, "PutProperty", sError)); } @@ -422,7 +424,7 @@ void JSSpecialPropDel(const char* class_name, CFX_WideString propname = CFX_WideString::FromUTF8( CFX_ByteStringC(*utf8_value, utf8_value.length())); CFX_WideString sError; - if (!pObj->DelProperty(pRuntime->GetCurrentContext(), propname.c_str(), + if (!pObj->DelProperty(pRuntime->GetCurrentEventContext(), propname.c_str(), sError)) { CFX_ByteString cbName; cbName.Format("%s.%s", class_name, "DelProperty"); @@ -430,7 +432,7 @@ void JSSpecialPropDel(const char* class_name, } } -template &, CJS_Value&, CFX_WideString&)> @@ -446,7 +448,7 @@ void JSGlobalFunc(const char* func_name_string, } CJS_Value valueRes(pRuntime); CFX_WideString sError; - if (!(*F)(pRuntime->GetCurrentContext(), parameters, valueRes, sError)) { + if (!(*F)(pRuntime->GetCurrentEventContext(), parameters, valueRes, sError)) { pRuntime->Error(JSFormatErrorString(func_name_string, nullptr, sError)); return; } -- cgit v1.2.3