diff options
author | Tom Sepez <tsepez@chromium.org> | 2017-02-16 11:49:55 -0800 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-02-16 20:23:48 +0000 |
commit | d6ae2afa821c87e84790d5c04bbc172a7b12f08f (patch) | |
tree | 10beb72deaffca61ccc54a3fb49ea0d9636579bb /fpdfsdk/javascript/JS_Define.h | |
parent | 49f7deb494064351c72ef4d31577e04f634e63f3 (diff) | |
download | pdfium-d6ae2afa821c87e84790d5c04bbc172a7b12f08f.tar.xz |
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 <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fpdfsdk/javascript/JS_Define.h')
-rw-r--r-- | fpdfsdk/javascript/JS_Define.h | 26 |
1 files changed, 14 insertions, 12 deletions
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 <class C, bool (C::*M)(IJS_Context*, CJS_PropValue&, CFX_WideString&)> +template <class C, + bool (C::*M)(IJS_EventContext*, CJS_PropValue&, CFX_WideString&)> void JSPropGetter(const char* prop_name_string, const char* class_name_string, v8::Local<v8::String> 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 <class C, bool (C::*M)(IJS_Context*, CJS_PropValue&, CFX_WideString&)> +template <class C, + bool (C::*M)(IJS_EventContext*, CJS_PropValue&, CFX_WideString&)> void JSPropSetter(const char* prop_name_string, const char* class_name_string, v8::Local<v8::String> 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 <class C, - bool (C::*M)(IJS_Context*, + bool (C::*M)(IJS_EventContext*, const std::vector<CJS_Value>&, CJS_Value&, CFX_WideString&)> @@ -150,7 +152,7 @@ void JSMethod(const char* method_name_string, C* pObj = reinterpret_cast<C*>(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 <bool (*F)(IJS_Context*, +template <bool (*F)(IJS_EventContext*, const std::vector<CJS_Value>&, 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; } |