| Index: fpdfsdk/src/javascript/JS_Runtime.cpp
|
| diff --git a/fpdfsdk/src/javascript/JS_Runtime.cpp b/fpdfsdk/src/javascript/JS_Runtime.cpp
|
| index a85067be1bc93434a1d8d632c3010acbc4617b81..bbe9f6e8c82477efacfb4caab061b7f436e12a73 100644
|
| --- a/fpdfsdk/src/javascript/JS_Runtime.cpp
|
| +++ b/fpdfsdk/src/javascript/JS_Runtime.cpp
|
| @@ -41,7 +41,7 @@ void CJS_RuntimeFactory::AddRef() {
|
| void CJS_RuntimeFactory::Release() {
|
| if (m_bInit) {
|
| if (--m_nRef == 0) {
|
| - JS_Release();
|
| + FXJS_Release();
|
| m_bInit = FALSE;
|
| }
|
| }
|
| @@ -69,7 +69,7 @@ CJS_Runtime::CJS_Runtime(CPDFDoc_Environment* pApp)
|
| m_pApp->GetFormFillInfo()->m_pJsPlatform->m_isolate);
|
| }
|
| if (!m_isolate) {
|
| - m_pArrayBufferAllocator.reset(new JS_ArrayBufferAllocator());
|
| + m_pArrayBufferAllocator.reset(new FXJS_ArrayBufferAllocator());
|
|
|
| v8::Isolate::CreateParams params;
|
| params.array_buffer_allocator = m_pArrayBufferAllocator.get();
|
| @@ -83,7 +83,7 @@ CJS_Runtime::CJS_Runtime(CPDFDoc_Environment* pApp)
|
| v8::HandleScope handle_scope(isolate);
|
| if (CPDFXFA_App::GetInstance()->InitRuntime(FALSE)) {
|
| CJS_Context* pContext = (CJS_Context*)NewContext();
|
| - JS_InitializeRuntime(GetIsolate(), this, pContext, m_context);
|
| + FXJS_InitializeRuntime(GetIsolate(), this, pContext, m_context);
|
| ReleaseContext(pContext);
|
| return;
|
| }
|
| @@ -91,11 +91,11 @@ CJS_Runtime::CJS_Runtime(CPDFDoc_Environment* pApp)
|
| unsigned int embedderDataSlot = 0;
|
| if (m_pApp->GetFormFillInfo()->m_pJsPlatform->version >= 2)
|
| embedderDataSlot = pApp->GetFormFillInfo()->m_pJsPlatform->m_v8EmbedderSlot;
|
| - JS_Initialize(embedderDataSlot);
|
| + FXJS_Initialize(embedderDataSlot);
|
| DefineJSObjects();
|
|
|
| CJS_Context* pContext = (CJS_Context*)NewContext();
|
| - JS_InitializeRuntime(GetIsolate(), this, pContext, m_context);
|
| + FXJS_InitializeRuntime(GetIsolate(), this, pContext, m_context);
|
| ReleaseContext(pContext);
|
| }
|
|
|
| @@ -105,7 +105,6 @@ CJS_Runtime::~CJS_Runtime() {
|
| delete m_ContextArray.GetAt(i);
|
|
|
| m_ContextArray.RemoveAll();
|
| -
|
| RemoveEventsInLoop(m_pFieldEventPath);
|
|
|
| m_pApp = NULL;
|
| @@ -127,34 +126,34 @@ void CJS_Runtime::DefineJSObjects() {
|
|
|
| // The call order determines the "ObjDefID" assigned to each class.
|
| // ObjDefIDs 0 - 2
|
| - CJS_Border::DefineJSObjects(GetIsolate(), JS_STATIC);
|
| - CJS_Display::DefineJSObjects(GetIsolate(), JS_STATIC);
|
| - CJS_Font::DefineJSObjects(GetIsolate(), JS_STATIC);
|
| + CJS_Border::DefineJSObjects(GetIsolate(), FXJS_STATIC);
|
| + CJS_Display::DefineJSObjects(GetIsolate(), FXJS_STATIC);
|
| + CJS_Font::DefineJSObjects(GetIsolate(), FXJS_STATIC);
|
|
|
| // ObjDefIDs 3 - 5
|
| - CJS_Highlight::DefineJSObjects(GetIsolate(), JS_STATIC);
|
| - CJS_Position::DefineJSObjects(GetIsolate(), JS_STATIC);
|
| - CJS_ScaleHow::DefineJSObjects(GetIsolate(), JS_STATIC);
|
| + CJS_Highlight::DefineJSObjects(GetIsolate(), FXJS_STATIC);
|
| + CJS_Position::DefineJSObjects(GetIsolate(), FXJS_STATIC);
|
| + CJS_ScaleHow::DefineJSObjects(GetIsolate(), FXJS_STATIC);
|
|
|
| // ObjDefIDs 6 - 8
|
| - CJS_ScaleWhen::DefineJSObjects(GetIsolate(), JS_STATIC);
|
| - CJS_Style::DefineJSObjects(GetIsolate(), JS_STATIC);
|
| - CJS_Zoomtype::DefineJSObjects(GetIsolate(), JS_STATIC);
|
| + CJS_ScaleWhen::DefineJSObjects(GetIsolate(), FXJS_STATIC);
|
| + CJS_Style::DefineJSObjects(GetIsolate(), FXJS_STATIC);
|
| + CJS_Zoomtype::DefineJSObjects(GetIsolate(), FXJS_STATIC);
|
|
|
| // ObjDefIDs 9 - 11
|
| - CJS_App::DefineJSObjects(GetIsolate(), JS_STATIC);
|
| - CJS_Color::DefineJSObjects(GetIsolate(), JS_STATIC);
|
| - CJS_Console::DefineJSObjects(GetIsolate(), JS_STATIC);
|
| + CJS_App::DefineJSObjects(GetIsolate(), FXJS_STATIC);
|
| + CJS_Color::DefineJSObjects(GetIsolate(), FXJS_STATIC);
|
| + CJS_Console::DefineJSObjects(GetIsolate(), FXJS_STATIC);
|
|
|
| // ObjDefIDs 12 - 14
|
| - CJS_Document::DefineJSObjects(GetIsolate(), JS_DYNAMIC);
|
| - CJS_Event::DefineJSObjects(GetIsolate(), JS_STATIC);
|
| - CJS_Field::DefineJSObjects(GetIsolate(), JS_DYNAMIC);
|
| + CJS_Document::DefineJSObjects(GetIsolate(), FXJS_DYNAMIC);
|
| + CJS_Event::DefineJSObjects(GetIsolate(), FXJS_STATIC);
|
| + CJS_Field::DefineJSObjects(GetIsolate(), FXJS_DYNAMIC);
|
|
|
| // ObjDefIDs 15 - 17
|
| - CJS_Global::DefineJSObjects(GetIsolate(), JS_STATIC);
|
| - CJS_Icon::DefineJSObjects(GetIsolate(), JS_DYNAMIC);
|
| - CJS_Util::DefineJSObjects(GetIsolate(), JS_STATIC);
|
| + CJS_Global::DefineJSObjects(GetIsolate(), FXJS_STATIC);
|
| + CJS_Icon::DefineJSObjects(GetIsolate(), FXJS_DYNAMIC);
|
| + CJS_Util::DefineJSObjects(GetIsolate(), FXJS_STATIC);
|
|
|
| // ObjDefIDs 18 - 20 (these can't fail, return void).
|
| CJS_PublicMethods::DefineJSObjects(GetIsolate());
|
| @@ -162,8 +161,8 @@ void CJS_Runtime::DefineJSObjects() {
|
| CJS_GlobalArrays::DefineJSObjects(GetIsolate());
|
|
|
| // ObjDefIDs 21 - 22.
|
| - CJS_TimerObj::DefineJSObjects(GetIsolate(), JS_DYNAMIC);
|
| - CJS_PrintParamsObj::DefineJSObjects(GetIsolate(), JS_DYNAMIC);
|
| + CJS_TimerObj::DefineJSObjects(GetIsolate(), FXJS_DYNAMIC);
|
| + CJS_PrintParamsObj::DefineJSObjects(GetIsolate(), FXJS_DYNAMIC);
|
| }
|
|
|
| IFXJS_Context* CJS_Runtime::NewContext() {
|
| @@ -201,11 +200,12 @@ void CJS_Runtime::SetReaderDocument(CPDFSDK_Document* pReaderDoc) {
|
|
|
| m_pDocument = pReaderDoc;
|
| if (pReaderDoc) {
|
| - v8::Local<v8::Object> pThis = JS_GetThisObj(GetIsolate());
|
| + v8::Local<v8::Object> pThis = FXJS_GetThisObj(GetIsolate());
|
| if (!pThis.IsEmpty()) {
|
| - if (JS_GetObjDefnID(pThis) ==
|
| - JS_GetObjDefnID(GetIsolate(), L"Document")) {
|
| - if (CJS_Document* pJSDocument = (CJS_Document*)JS_GetPrivate(pThis)) {
|
| + if (FXJS_GetObjDefnID(pThis) ==
|
| + FXJS_GetObjDefnID(GetIsolate(), L"Document")) {
|
| + if (CJS_Document* pJSDocument =
|
| + (CJS_Document*)FXJS_GetPrivate(pThis)) {
|
| if (Document* pDocument = (Document*)pJSDocument->GetEmbedObject())
|
| pDocument->AttachDoc(pReaderDoc);
|
| }
|
|
|