summaryrefslogtreecommitdiff
path: root/fpdfsdk/include
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-10-08 12:03:00 -0700
committerTom Sepez <tsepez@chromium.org>2015-10-08 12:03:00 -0700
commitba038bc14bfeb4d011d57f388871f7f14c4c3c22 (patch)
tree2786d0c3d7c56492c09f9c01e4eae090023c4040 /fpdfsdk/include
parent4d4a442aa413cdf5e114c4e432ae930bc9d9e0f1 (diff)
downloadpdfium-ba038bc14bfeb4d011d57f388871f7f14c4c3c22.tar.xz
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 .
Diffstat (limited to 'fpdfsdk/include')
-rw-r--r--fpdfsdk/include/fpdfxfa/fpdfxfa_doc.h8
-rw-r--r--fpdfsdk/include/fsdk_mgr.h6
-rw-r--r--fpdfsdk/include/javascript/IJavaScript.h18
-rw-r--r--fpdfsdk/include/jsapi/fxjs_v8.h24
4 files changed, 30 insertions, 26 deletions
diff --git a/fpdfsdk/include/fpdfxfa/fpdfxfa_doc.h b/fpdfsdk/include/fpdfxfa/fpdfxfa_doc.h
index 1ddb99064f..3c33338b39 100644
--- a/fpdfsdk/include/fpdfxfa/fpdfxfa_doc.h
+++ b/fpdfsdk/include/fpdfxfa/fpdfxfa_doc.h
@@ -14,8 +14,8 @@ class CPDFXFA_Document;
class CPDFXFA_Page;
class CPDFSDK_Document;
class CPDFDoc_Environment;
-class IFXJS_Runtime;
-class IFXJS_Context;
+class IJS_Runtime;
+class IJS_Context;
class IXFA_DocHandler;
class CPDFXFA_Document : public IXFA_DocProvider {
@@ -187,7 +187,7 @@ class CPDFXFA_Document : public IXFA_DocProvider {
FX_BOOL _GetHValueByName(const CFX_ByteStringC& utf8Name,
FXJSE_HVALUE hValue,
- IFXJS_Runtime* runTime);
+ IJS_Runtime* runTime);
FX_BOOL _OnBeforeNotifySumbit();
void _OnAfterNotifySumbit();
FX_BOOL _NotifySubmit(FX_BOOL bPrevOrPost);
@@ -221,7 +221,7 @@ class CPDFXFA_Document : public IXFA_DocProvider {
CFX_ArrayTemplate<CPDFXFA_Page*> m_XFAPageList;
CPDFSDK_Document* m_pSDKDoc;
CPDFXFA_App* m_pApp;
- IFXJS_Context* m_pJSContext;
+ IJS_Context* m_pJSContext;
int m_iDocType;
};
diff --git a/fpdfsdk/include/fsdk_mgr.h b/fpdfsdk/include/fsdk_mgr.h
index d53a21e94a..aceb40fa3c 100644
--- a/fpdfsdk/include/fsdk_mgr.h
+++ b/fpdfsdk/include/fsdk_mgr.h
@@ -455,13 +455,13 @@ class CPDFDoc_Environment final {
CFFL_IFormFiller* GetIFormFiller(); // Creates if not present.
CPDFSDK_AnnotHandlerMgr* GetAnnotHandlerMgr(); // Creates if not present.
- IFXJS_Runtime* GetJSRuntime(); // Creates if not present.
+ IJS_Runtime* GetJSRuntime(); // Creates if not present.
CPDFSDK_ActionHandler* GetActionHander(); // Creates if not present.
private:
CPDFSDK_AnnotHandlerMgr* m_pAnnotHandlerMgr;
CPDFSDK_ActionHandler* m_pActionHandler;
- nonstd::unique_ptr<IFXJS_Runtime> m_pJSRuntime;
+ nonstd::unique_ptr<IJS_Runtime> m_pJSRuntime;
FPDF_FORMFILLINFO* const m_pInfo;
CPDFSDK_Document* m_pSDKDoc;
CPDFXFA_Document* const m_pXFADoc;
@@ -487,7 +487,7 @@ class CPDFSDK_Document {
CPDFSDK_Annot* GetFocusAnnot();
- IFXJS_Runtime* GetJsRuntime();
+ IJS_Runtime* GetJsRuntime();
FX_BOOL SetFocusAnnot(CPDFSDK_Annot* pAnnot, FX_UINT nFlag = 0);
FX_BOOL KillFocusAnnot(FX_UINT nFlag = 0);
diff --git a/fpdfsdk/include/javascript/IJavaScript.h b/fpdfsdk/include/javascript/IJavaScript.h
index 4d70aa15aa..fc8bf2bd7c 100644
--- a/fpdfsdk/include/javascript/IJavaScript.h
+++ b/fpdfsdk/include/javascript/IJavaScript.h
@@ -17,7 +17,7 @@ class CPDFSDK_Document;
class CPDF_Bookmark;
class CPDF_FormField;
-class IFXJS_Context {
+class IJS_Context {
public:
virtual FX_BOOL RunScript(const CFX_WideString& script,
CFX_WideString& info) = 0;
@@ -129,17 +129,17 @@ class IFXJS_Context {
virtual void EnableMessageBox(FX_BOOL bEnable) = 0;
protected:
- virtual ~IFXJS_Context() {}
+ virtual ~IJS_Context() {}
};
-class IFXJS_Runtime {
+class IJS_Runtime {
public:
- static IFXJS_Runtime* Create(CPDFDoc_Environment* pEnv);
- virtual ~IFXJS_Runtime() {}
+ static IJS_Runtime* Create(CPDFDoc_Environment* pEnv);
+ virtual ~IJS_Runtime() {}
- virtual IFXJS_Context* NewContext() = 0;
- virtual void ReleaseContext(IFXJS_Context* pContext) = 0;
- virtual IFXJS_Context* GetCurrentContext() = 0;
+ virtual IJS_Context* NewContext() = 0;
+ virtual void ReleaseContext(IJS_Context* pContext) = 0;
+ virtual IJS_Context* GetCurrentContext() = 0;
virtual void SetReaderDocument(CPDFSDK_Document* pReaderDoc) = 0;
virtual CPDFSDK_Document* GetReaderDocument() = 0;
@@ -150,7 +150,7 @@ class IFXJS_Runtime {
FXJSE_HVALUE hValue) = 0;
protected:
- IFXJS_Runtime() {}
+ IJS_Runtime() {}
};
#endif // FPDFSDK_INCLUDE_JAVASCRIPT_IJAVASCRIPT_H_
diff --git a/fpdfsdk/include/jsapi/fxjs_v8.h b/fpdfsdk/include/jsapi/fxjs_v8.h
index 750d7a8fae..f4f9d46852 100644
--- a/fpdfsdk/include/jsapi/fxjs_v8.h
+++ b/fpdfsdk/include/jsapi/fxjs_v8.h
@@ -4,8 +4,12 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-// PDFium wrapper around V8 APIs. PDFium code should include this file rather
-// than including V8 headers directly.
+// FXJS_V8 is a layer that makes it easier to define native objects in V8, but
+// has no knowledge of PDF-specific native objects. It could in theory be used
+// to implement other sets of native objects.
+
+// PDFium code should include this file rather than including V8 headers
+// directly.
#ifndef FPDFSDK_INCLUDE_JSAPI_FXJS_V8_H_
#define FPDFSDK_INCLUDE_JSAPI_FXJS_V8_H_
@@ -15,8 +19,8 @@
// FXJS_V8 places no interpretation on these two classes; it merely
// passes them on to the caller-provided FXJS_CONSTRUCTORs.
-class IFXJS_Context;
-class IFXJS_Runtime;
+class IJS_Context;
+class IJS_Runtime;
// FXJS_V8 places no interpreation on this calass; it merely passes it
// along to XFA.
@@ -62,7 +66,7 @@ class FXJS_ArrayBufferAllocator : public v8::ArrayBuffer::Allocator {
void Free(void* data, size_t length) override;
};
-using FXJS_CONSTRUCTOR = void (*)(IFXJS_Context* cc, v8::Local<v8::Object> obj);
+using FXJS_CONSTRUCTOR = void (*)(IJS_Context* cc, v8::Local<v8::Object> obj);
using FXJS_DESTRUCTOR = void (*)(v8::Local<v8::Object> obj);
// Call before making FXJS_PrepareIsolate call.
@@ -117,22 +121,22 @@ void FXJS_DefineGlobalConst(v8::Isolate* pIsolate,
// Called after FXJS_Define* calls made.
void FXJS_InitializeRuntime(v8::Isolate* pIsolate,
- IFXJS_Runtime* pFXRuntime,
- IFXJS_Context* context,
+ IJS_Runtime* pFXRuntime,
+ IJS_Context* context,
v8::Global<v8::Context>& v8PersistentContext);
void FXJS_ReleaseRuntime(v8::Isolate* pIsolate,
v8::Global<v8::Context>& v8PersistentContext);
-IFXJS_Runtime* FXJS_GetRuntimeFromIsolate(v8::Isolate* pIsolate);
+IJS_Runtime* FXJS_GetRuntimeFromIsolate(v8::Isolate* pIsolate);
// Called after FXJS_InitializeRuntime call made.
int FXJS_Execute(v8::Isolate* pIsolate,
- IFXJS_Context* pJSContext,
+ IJS_Context* pJSContext,
const wchar_t* script,
long length,
FXJSErr* perror);
v8::Local<v8::Object> FXJS_NewFxDynamicObj(v8::Isolate* pIsolate,
- IFXJS_Context* pJSContext,
+ IJS_Context* pJSContext,
int nObjDefnID);
v8::Local<v8::Object> FXJS_GetThisObj(v8::Isolate* pIsolate);
int FXJS_GetObjDefnID(v8::Local<v8::Object> pObj);