From ba038bc14bfeb4d011d57f388871f7f14c4c3c22 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Thu, 8 Oct 2015 12:03:00 -0700 Subject: Merge to XFA: Rename IFXJS_Runtime and IFXJS_Context to IJS_. Merge conflicts in: fpdfsdk/src/javascript/Document.cpp fpdfsdk/src/javascript/JS_Define.h New code in: fpdfsdk/include/fpdfxfa/fpdfxfa_doc.h fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp (cherry picked from commit 213a172779fddbd7e588ee2e2b3906ccc47d6896) Original Review URL: https://codereview.chromium.org/1386173002 . R=thestig@chromium.org Review URL: https://codereview.chromium.org/1395713002 . --- fpdfsdk/src/javascript/JS_Define.h | 50 +++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 25 deletions(-) (limited to 'fpdfsdk/src/javascript/JS_Define.h') diff --git a/fpdfsdk/src/javascript/JS_Define.h b/fpdfsdk/src/javascript/JS_Define.h index eaad4708d8..2ea278d802 100644 --- a/fpdfsdk/src/javascript/JS_Define.h +++ b/fpdfsdk/src/javascript/JS_Define.h @@ -72,16 +72,16 @@ struct JSMethodSpec { ; template + FX_BOOL (C::*M)(IJS_Context*, CJS_PropValue&, CFX_WideString&)> void JSPropGetter(const char* prop_name_string, const char* class_name_string, v8::Local property, const v8::PropertyCallbackInfo& info) { v8::Isolate* isolate = info.GetIsolate(); - IFXJS_Runtime* pRuntime = FXJS_GetRuntimeFromIsolate(isolate); + IJS_Runtime* pRuntime = FXJS_GetRuntimeFromIsolate(isolate); if (!pRuntime) return; - IFXJS_Context* pRuntimeContext = pRuntime->GetCurrentContext(); + IJS_Context* pRuntimeContext = pRuntime->GetCurrentContext(); CJS_Object* pJSObj = (CJS_Object*)FXJS_GetPrivate(isolate, info.Holder()); C* pObj = reinterpret_cast(pJSObj->GetEmbedObject()); CFX_WideString sError; @@ -96,17 +96,17 @@ void JSPropGetter(const char* prop_name_string, } template + FX_BOOL (C::*M)(IJS_Context*, CJS_PropValue&, CFX_WideString&)> void JSPropSetter(const char* prop_name_string, const char* class_name_string, v8::Local property, v8::Local value, const v8::PropertyCallbackInfo& info) { v8::Isolate* isolate = info.GetIsolate(); - IFXJS_Runtime* pRuntime = FXJS_GetRuntimeFromIsolate(isolate); + IJS_Runtime* pRuntime = FXJS_GetRuntimeFromIsolate(isolate); if (!pRuntime) return; - IFXJS_Context* pRuntimeContext = pRuntime->GetCurrentContext(); + IJS_Context* pRuntimeContext = pRuntime->GetCurrentContext(); CJS_Object* pJSObj = (CJS_Object*)FXJS_GetPrivate(isolate, info.Holder()); C* pObj = reinterpret_cast(pJSObj->GetEmbedObject()); CFX_WideString sError; @@ -133,7 +133,7 @@ void JSPropSetter(const char* prop_name_string, } template @@ -141,10 +141,10 @@ void JSMethod(const char* method_name_string, const char* class_name_string, const v8::FunctionCallbackInfo& info) { v8::Isolate* isolate = info.GetIsolate(); - IFXJS_Runtime* pRuntime = FXJS_GetRuntimeFromIsolate(isolate); + IJS_Runtime* pRuntime = FXJS_GetRuntimeFromIsolate(isolate); if (!pRuntime) return; - IFXJS_Context* pRuntimeContext = pRuntime->GetCurrentContext(); + IJS_Context* pRuntimeContext = pRuntime->GetCurrentContext(); CJS_Parameters parameters; for (unsigned int i = 0; i < (unsigned int)info.Length(); i++) { parameters.push_back(CJS_Value(isolate, info[i], CJS_Value::VT_unknown)); @@ -242,17 +242,17 @@ void JSMethod(const char* method_name_string, DefineMethods(pIsolate); \ } -#define DECLARE_JS_CLASS_RICH_PART() \ - static void JSConstructor(IFXJS_Context* cc, v8::Local obj); \ - static void JSDestructor(v8::Local obj); \ - static void DefineProps(v8::Isolate* pIsoalte); \ - static void DefineMethods(v8::Isolate* pIsoalte); \ - static JSPropertySpec JS_Class_Properties[]; \ +#define DECLARE_JS_CLASS_RICH_PART() \ + static void JSConstructor(IJS_Context* cc, v8::Local obj); \ + static void JSDestructor(v8::Local obj); \ + static void DefineProps(v8::Isolate* pIsoalte); \ + static void DefineMethods(v8::Isolate* pIsoalte); \ + static JSPropertySpec JS_Class_Properties[]; \ static JSMethodSpec JS_Class_Methods[]; #define IMPLEMENT_JS_CLASS_RICH_PART(js_class_name, class_alternate, \ class_name) \ - void js_class_name::JSConstructor(IFXJS_Context* cc, \ + void js_class_name::JSConstructor(IJS_Context* cc, \ v8::Local obj) { \ CJS_Object* pObj = new js_class_name(obj); \ pObj->SetEmbedObject(new class_alternate(pObj)); \ @@ -363,10 +363,10 @@ void JSSpecialPropGet(const char* class_name, v8::Local property, const v8::PropertyCallbackInfo& info) { v8::Isolate* isolate = info.GetIsolate(); - IFXJS_Runtime* pRuntime = FXJS_GetRuntimeFromIsolate(isolate); + IJS_Runtime* pRuntime = FXJS_GetRuntimeFromIsolate(isolate); if (!pRuntime) return; - IFXJS_Context* pRuntimeContext = pRuntime->GetCurrentContext(); + IJS_Context* pRuntimeContext = pRuntime->GetCurrentContext(); CJS_Object* pJSObj = reinterpret_cast(FXJS_GetPrivate(isolate, info.Holder())); Alt* pObj = reinterpret_cast(pJSObj->GetEmbedObject()); @@ -389,10 +389,10 @@ void JSSpecialPropPut(const char* class_name, v8::Local value, const v8::PropertyCallbackInfo& info) { v8::Isolate* isolate = info.GetIsolate(); - IFXJS_Runtime* pRuntime = FXJS_GetRuntimeFromIsolate(isolate); + IJS_Runtime* pRuntime = FXJS_GetRuntimeFromIsolate(isolate); if (!pRuntime) return; - IFXJS_Context* pRuntimeContext = pRuntime->GetCurrentContext(); + IJS_Context* pRuntimeContext = pRuntime->GetCurrentContext(); CJS_Object* pJSObj = reinterpret_cast(FXJS_GetPrivate(isolate, info.Holder())); Alt* pObj = reinterpret_cast(pJSObj->GetEmbedObject()); @@ -412,10 +412,10 @@ void JSSpecialPropDel(const char* class_name, v8::Local property, const v8::PropertyCallbackInfo& info) { v8::Isolate* isolate = info.GetIsolate(); - IFXJS_Runtime* pRuntime = FXJS_GetRuntimeFromIsolate(isolate); + IJS_Runtime* pRuntime = FXJS_GetRuntimeFromIsolate(isolate); if (!pRuntime) return; - IFXJS_Context* pRuntimeContext = pRuntime->GetCurrentContext(); + IJS_Context* pRuntimeContext = pRuntime->GetCurrentContext(); CJS_Object* pJSObj = reinterpret_cast(FXJS_GetPrivate(isolate, info.Holder())); Alt* pObj = reinterpret_cast(pJSObj->GetEmbedObject()); @@ -430,17 +430,17 @@ void JSSpecialPropDel(const char* class_name, } } -template void JSGlobalFunc(const char* func_name_string, const v8::FunctionCallbackInfo& info) { v8::Isolate* isolate = info.GetIsolate(); - IFXJS_Runtime* pRuntime = FXJS_GetRuntimeFromIsolate(isolate); + IJS_Runtime* pRuntime = FXJS_GetRuntimeFromIsolate(isolate); if (!pRuntime) return; - IFXJS_Context* pRuntimeContext = pRuntime->GetCurrentContext(); + IJS_Context* pRuntimeContext = pRuntime->GetCurrentContext(); CJS_Parameters parameters; for (unsigned int i = 0; i < (unsigned int)info.Length(); i++) { parameters.push_back(CJS_Value(isolate, info[i], CJS_Value::VT_unknown)); -- cgit v1.2.3