summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/javascript/JS_EventHandler.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-09-16 10:42:08 -0700
committerTom Sepez <tsepez@chromium.org>2015-09-16 10:42:08 -0700
commit506df426d5d64d68e9dc27ffebcf56f6c6a1bccf (patch)
tree3ba8d38a3bef95c0555549953bce0cce90845cdb /fpdfsdk/src/javascript/JS_EventHandler.cpp
parent615d7aba0f7d53a78eb05fbd4ae0e1a7e1d3b103 (diff)
downloadpdfium-506df426d5d64d68e9dc27ffebcf56f6c6a1bccf.tar.xz
Ensure functions in FXJS_V8 are prefixed by FXJS_.
Currently, its hard to tell which functions come from the JS_ layer at fpdfsdk/include/javascript vs. which functions come from the FXJS_V8 layer at fpdfsdk/include/jsapi. Until we take up the task of using namespaces, at least make the prefix consistent. Move objects out of FXJS_V8 that are really part of JS_. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1347833002 .
Diffstat (limited to 'fpdfsdk/src/javascript/JS_EventHandler.cpp')
-rw-r--r--fpdfsdk/src/javascript/JS_EventHandler.cpp32
1 files changed, 14 insertions, 18 deletions
diff --git a/fpdfsdk/src/javascript/JS_EventHandler.cpp b/fpdfsdk/src/javascript/JS_EventHandler.cpp
index acaacf2943..bd762b4946 100644
--- a/fpdfsdk/src/javascript/JS_EventHandler.cpp
+++ b/fpdfsdk/src/javascript/JS_EventHandler.cpp
@@ -615,19 +615,17 @@ Field* CJS_EventHandler::Source() {
CJS_Runtime* pRuntime = m_pJSContext->GetJSRuntime();
- v8::Local<v8::Object> pDocObj =
- JS_NewFxDynamicObj(pRuntime->GetIsolate(), m_pJSContext,
- JS_GetObjDefnID(pRuntime->GetIsolate(), L"Document"));
+ v8::Local<v8::Object> pDocObj = FXJS_NewFxDynamicObj(
+ pRuntime->GetIsolate(), m_pJSContext,
+ FXJS_GetObjDefnID(pRuntime->GetIsolate(), L"Document"));
ASSERT(pDocObj.IsEmpty() == FALSE);
v8::Local<v8::Object> pFieldObj =
- JS_NewFxDynamicObj(pRuntime->GetIsolate(), m_pJSContext,
- JS_GetObjDefnID(pRuntime->GetIsolate(), L"Field"));
+ FXJS_NewFxDynamicObj(pRuntime->GetIsolate(), m_pJSContext,
+ FXJS_GetObjDefnID(pRuntime->GetIsolate(), L"Field"));
ASSERT(pFieldObj.IsEmpty() == FALSE);
- CJS_Document* pJSDocument = (CJS_Document*)JS_GetPrivate(pDocObj);
- ASSERT(pJSDocument != NULL);
+ CJS_Document* pJSDocument = (CJS_Document*)FXJS_GetPrivate(pDocObj);
Document* pDocument = (Document*)pJSDocument->GetEmbedObject();
- ASSERT(pDocument != NULL);
if (m_pTargetDoc != NULL)
pDocument->AttachDoc(m_pTargetDoc);
else
@@ -639,7 +637,7 @@ Field* CJS_EventHandler::Source() {
// CPDF_FormField* pFormField = pWidget->GetFormField();
// ASSERT(pFormField);
// CFX_WideString csFieldName = pFormField->GetFullName();
- CJS_Field* pJSField = (CJS_Field*)JS_GetPrivate(pFieldObj);
+ CJS_Field* pJSField = (CJS_Field*)FXJS_GetPrivate(pFieldObj);
ASSERT(pJSField != NULL);
Field* pField = (Field*)pJSField->GetEmbedObject();
ASSERT(pField != NULL);
@@ -652,25 +650,23 @@ Field* CJS_EventHandler::Target_Field() {
CJS_Runtime* pRuntime = m_pJSContext->GetJSRuntime();
- v8::Local<v8::Object> pDocObj =
- JS_NewFxDynamicObj(pRuntime->GetIsolate(), m_pJSContext,
- JS_GetObjDefnID(pRuntime->GetIsolate(), L"Document"));
+ v8::Local<v8::Object> pDocObj = FXJS_NewFxDynamicObj(
+ pRuntime->GetIsolate(), m_pJSContext,
+ FXJS_GetObjDefnID(pRuntime->GetIsolate(), L"Document"));
ASSERT(pDocObj.IsEmpty() == FALSE);
v8::Local<v8::Object> pFieldObj =
- JS_NewFxDynamicObj(pRuntime->GetIsolate(), m_pJSContext,
- JS_GetObjDefnID(pRuntime->GetIsolate(), L"Field"));
+ FXJS_NewFxDynamicObj(pRuntime->GetIsolate(), m_pJSContext,
+ FXJS_GetObjDefnID(pRuntime->GetIsolate(), L"Field"));
ASSERT(pFieldObj.IsEmpty() == FALSE);
- CJS_Document* pJSDocument = (CJS_Document*)JS_GetPrivate(pDocObj);
- ASSERT(pJSDocument != NULL);
+ CJS_Document* pJSDocument = (CJS_Document*)FXJS_GetPrivate(pDocObj);
Document* pDocument = (Document*)pJSDocument->GetEmbedObject();
- ASSERT(pDocument != NULL);
if (m_pTargetDoc != NULL)
pDocument->AttachDoc(m_pTargetDoc);
else
pDocument->AttachDoc(m_pJSContext->GetReaderDocument());
- CJS_Field* pJSField = (CJS_Field*)JS_GetPrivate(pFieldObj);
+ CJS_Field* pJSField = (CJS_Field*)FXJS_GetPrivate(pFieldObj);
ASSERT(pJSField != NULL);
Field* pField = (Field*)pJSField->GetEmbedObject();