summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-10-06 11:33:46 -0700
committerTom Sepez <tsepez@chromium.org>2015-10-06 11:33:46 -0700
commit3745841a4c4ab915c98865c1dd71f9debc3e2f99 (patch)
tree9d43ea977a9f50faa40391f38264f6695527555c
parent1b1dd8a6907f4631044b1c03698170853af594a9 (diff)
downloadpdfium-3745841a4c4ab915c98865c1dd71f9debc3e2f99.tar.xz
Merge to XFA: Make the vast majority of JS headers private to src/javascript.
(cherry picked from commit 5b3d0208723f21c50b9922bdc500c9d78c359a25) Original Review URL: https://codereview.chromium.org/1389783002 . New changes to fix IWYU in: fpdfsdk/include/fpdfxfa/fpdfxfa_app.h xfa/include/fxfa/fxfa.h xfa/include/fxfa/fxfa_objectacc.h R=thestig@chromium.org Review URL: https://codereview.chromium.org/1388023003 .
-rw-r--r--BUILD.gn51
-rw-r--r--fpdfsdk/include/fpdfxfa/fpdfxfa_app.h2
-rw-r--r--fpdfsdk/include/javascript/IJavaScript.h4
-rw-r--r--fpdfsdk/src/fsdk_mgr.cpp9
-rw-r--r--fpdfsdk/src/javascript/Consts.cpp9
-rw-r--r--fpdfsdk/src/javascript/Consts.h (renamed from fpdfsdk/include/javascript/Consts.h)6
-rw-r--r--fpdfsdk/src/javascript/Document.cpp25
-rw-r--r--fpdfsdk/src/javascript/Document.h (renamed from fpdfsdk/include/javascript/Document.h)6
-rw-r--r--fpdfsdk/src/javascript/Field.cpp24
-rw-r--r--fpdfsdk/src/javascript/Field.h (renamed from fpdfsdk/include/javascript/Field.h)9
-rw-r--r--fpdfsdk/src/javascript/Icon.cpp9
-rw-r--r--fpdfsdk/src/javascript/Icon.h (renamed from fpdfsdk/include/javascript/Icon.h)6
-rw-r--r--fpdfsdk/src/javascript/JS_Context.cpp9
-rw-r--r--fpdfsdk/src/javascript/JS_Context.h (renamed from fpdfsdk/include/javascript/JS_Context.h)8
-rw-r--r--fpdfsdk/src/javascript/JS_Define.h (renamed from fpdfsdk/include/javascript/JS_Define.h)17
-rw-r--r--fpdfsdk/src/javascript/JS_EventHandler.cpp17
-rw-r--r--fpdfsdk/src/javascript/JS_EventHandler.h (renamed from fpdfsdk/include/javascript/JS_EventHandler.h)6
-rw-r--r--fpdfsdk/src/javascript/JS_GlobalData.cpp3
-rw-r--r--fpdfsdk/src/javascript/JS_GlobalData.h (renamed from fpdfsdk/include/javascript/JS_GlobalData.h)6
-rw-r--r--fpdfsdk/src/javascript/JS_Object.cpp8
-rw-r--r--fpdfsdk/src/javascript/JS_Object.h (renamed from fpdfsdk/include/javascript/JS_Object.h)15
-rw-r--r--fpdfsdk/src/javascript/JS_Runtime.cpp48
-rw-r--r--fpdfsdk/src/javascript/JS_Runtime.h (renamed from fpdfsdk/include/javascript/JS_Runtime.h)10
-rw-r--r--fpdfsdk/src/javascript/JS_Value.cpp9
-rw-r--r--fpdfsdk/src/javascript/JS_Value.h (renamed from fpdfsdk/include/javascript/JS_Value.h)8
-rw-r--r--fpdfsdk/src/javascript/PublicMethods.cpp25
-rw-r--r--fpdfsdk/src/javascript/PublicMethods.h (renamed from fpdfsdk/include/javascript/PublicMethods.h)6
-rw-r--r--fpdfsdk/src/javascript/app.cpp20
-rw-r--r--fpdfsdk/src/javascript/app.h (renamed from fpdfsdk/include/javascript/app.h)6
-rw-r--r--fpdfsdk/src/javascript/color.cpp14
-rw-r--r--fpdfsdk/src/javascript/color.h (renamed from fpdfsdk/include/javascript/color.h)8
-rw-r--r--fpdfsdk/src/javascript/console.cpp13
-rw-r--r--fpdfsdk/src/javascript/console.h (renamed from fpdfsdk/include/javascript/console.h)6
-rw-r--r--fpdfsdk/src/javascript/event.cpp15
-rw-r--r--fpdfsdk/src/javascript/event.h (renamed from fpdfsdk/include/javascript/event.h)6
-rw-r--r--fpdfsdk/src/javascript/global.cpp19
-rw-r--r--fpdfsdk/src/javascript/global.h (renamed from fpdfsdk/include/javascript/global.h)6
-rw-r--r--fpdfsdk/src/javascript/report.cpp9
-rw-r--r--fpdfsdk/src/javascript/report.h (renamed from fpdfsdk/include/javascript/report.h)6
-rw-r--r--fpdfsdk/src/javascript/resource.cpp2
-rw-r--r--fpdfsdk/src/javascript/resource.h (renamed from fpdfsdk/include/javascript/resource.h)8
-rw-r--r--fpdfsdk/src/javascript/util.cpp19
-rw-r--r--fpdfsdk/src/javascript/util.h (renamed from fpdfsdk/include/javascript/util.h)6
-rw-r--r--fpdfsdk/src/jsapi/fxjs_v8_embeddertest.cpp5
-rw-r--r--pdfium.gyp47
-rw-r--r--xfa/include/fxfa/fxfa.h19
-rw-r--r--xfa/include/fxfa/fxfa_objectacc.h10
47 files changed, 317 insertions, 282 deletions
diff --git a/BUILD.gn b/BUILD.gn
index a4423f228b..13fd82f1d3 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -650,47 +650,46 @@ static_library("pdfwindow") {
static_library("javascript") {
sources = [
- "fpdfsdk/include/javascript/app.h",
- "fpdfsdk/include/javascript/color.h",
- "fpdfsdk/include/javascript/console.h",
- "fpdfsdk/include/javascript/Consts.h",
- "fpdfsdk/include/javascript/Document.h",
- "fpdfsdk/include/javascript/event.h",
- "fpdfsdk/include/javascript/Field.h",
- "fpdfsdk/include/javascript/global.h",
- "fpdfsdk/include/javascript/Icon.h",
"fpdfsdk/include/javascript/IJavaScript.h",
- "fpdfsdk/include/javascript/JavaScript.h",
- "fpdfsdk/include/javascript/JS_Context.h",
- "fpdfsdk/include/javascript/JS_Define.h",
- "fpdfsdk/include/javascript/JS_EventHandler.h",
- "fpdfsdk/include/javascript/JS_GlobalData.h",
- "fpdfsdk/include/javascript/JS_Object.h",
- "fpdfsdk/include/javascript/JS_Runtime.h",
- "fpdfsdk/include/javascript/JS_Value.h",
- "fpdfsdk/include/javascript/PublicMethods.h",
- "fpdfsdk/include/javascript/report.h",
- "fpdfsdk/include/javascript/resource.h",
- "fpdfsdk/include/javascript/util.h",
- "fpdfsdk/src/javascript/app.cpp",
- "fpdfsdk/src/javascript/color.cpp",
- "fpdfsdk/src/javascript/console.cpp",
"fpdfsdk/src/javascript/Consts.cpp",
+ "fpdfsdk/src/javascript/Consts.h",
"fpdfsdk/src/javascript/Document.cpp",
- "fpdfsdk/src/javascript/event.cpp",
+ "fpdfsdk/src/javascript/Document.h",
"fpdfsdk/src/javascript/Field.cpp",
- "fpdfsdk/src/javascript/global.cpp",
+ "fpdfsdk/src/javascript/Field.h",
"fpdfsdk/src/javascript/Icon.cpp",
+ "fpdfsdk/src/javascript/Icon.h",
"fpdfsdk/src/javascript/JS_Context.cpp",
+ "fpdfsdk/src/javascript/JS_Context.h",
+ "fpdfsdk/src/javascript/JS_Define.h",
"fpdfsdk/src/javascript/JS_EventHandler.cpp",
+ "fpdfsdk/src/javascript/JS_EventHandler.h",
"fpdfsdk/src/javascript/JS_GlobalData.cpp",
+ "fpdfsdk/src/javascript/JS_GlobalData.h",
"fpdfsdk/src/javascript/JS_Object.cpp",
+ "fpdfsdk/src/javascript/JS_Object.h",
"fpdfsdk/src/javascript/JS_Runtime.cpp",
+ "fpdfsdk/src/javascript/JS_Runtime.h",
"fpdfsdk/src/javascript/JS_Value.cpp",
+ "fpdfsdk/src/javascript/JS_Value.h",
"fpdfsdk/src/javascript/PublicMethods.cpp",
+ "fpdfsdk/src/javascript/PublicMethods.h",
+ "fpdfsdk/src/javascript/app.cpp",
+ "fpdfsdk/src/javascript/app.h",
+ "fpdfsdk/src/javascript/color.cpp",
+ "fpdfsdk/src/javascript/color.h",
+ "fpdfsdk/src/javascript/console.cpp",
+ "fpdfsdk/src/javascript/console.h",
+ "fpdfsdk/src/javascript/event.cpp",
+ "fpdfsdk/src/javascript/event.h",
+ "fpdfsdk/src/javascript/global.cpp",
+ "fpdfsdk/src/javascript/global.h",
"fpdfsdk/src/javascript/report.cpp",
+ "fpdfsdk/src/javascript/report.h",
"fpdfsdk/src/javascript/resource.cpp",
+ "fpdfsdk/src/javascript/resource.h",
"fpdfsdk/src/javascript/util.cpp",
+ "fpdfsdk/src/javascript/util.h",
]
configs -= [ "//build/config/compiler:chromium_code" ]
diff --git a/fpdfsdk/include/fpdfxfa/fpdfxfa_app.h b/fpdfsdk/include/fpdfxfa/fpdfxfa_app.h
index f5052e3adf..c1061a5e75 100644
--- a/fpdfsdk/include/fpdfxfa/fpdfxfa_app.h
+++ b/fpdfsdk/include/fpdfxfa/fpdfxfa_app.h
@@ -7,6 +7,8 @@
#ifndef FPDFXFA_APP_H_
#define FPDFXFA_APP_H_
+#include "../../../xfa/include/fxfa/fxfa.h"
+
class IFXJS_Runtime;
class CPDFXFA_App : public IXFA_AppProvider {
diff --git a/fpdfsdk/include/javascript/IJavaScript.h b/fpdfsdk/include/javascript/IJavaScript.h
index d15ffc237e..4d70aa15aa 100644
--- a/fpdfsdk/include/javascript/IJavaScript.h
+++ b/fpdfsdk/include/javascript/IJavaScript.h
@@ -134,6 +134,7 @@ class IFXJS_Context {
class IFXJS_Runtime {
public:
+ static IFXJS_Runtime* Create(CPDFDoc_Environment* pEnv);
virtual ~IFXJS_Runtime() {}
virtual IFXJS_Context* NewContext() = 0;
@@ -147,6 +148,9 @@ class IFXJS_Runtime {
FXJSE_HVALUE hValue) = 0;
virtual FX_BOOL SetHValueByName(const CFX_ByteStringC& utf8Name,
FXJSE_HVALUE hValue) = 0;
+
+ protected:
+ IFXJS_Runtime() {}
};
#endif // FPDFSDK_INCLUDE_JAVASCRIPT_IJAVASCRIPT_H_
diff --git a/fpdfsdk/src/fsdk_mgr.cpp b/fpdfsdk/src/fsdk_mgr.cpp
index 346dacce59..c6395bfc83 100644
--- a/fpdfsdk/src/fsdk_mgr.cpp
+++ b/fpdfsdk/src/fsdk_mgr.cpp
@@ -5,15 +5,14 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
#include "../../public/fpdf_ext.h"
-#include "../include/fsdk_define.h"
+#include "../include/formfiller/FFL_FormFiller.h"
+#include "../include/fpdfxfa/fpdfxfa_app.h"
#include "../include/fpdfxfa/fpdfxfa_doc.h"
#include "../include/fpdfxfa/fpdfxfa_page.h"
#include "../include/fpdfxfa/fpdfxfa_util.h"
+#include "../include/fsdk_define.h"
#include "../include/fsdk_mgr.h"
-#include "../include/formfiller/FFL_FormFiller.h"
#include "../include/javascript/IJavaScript.h"
-#include "../include/fpdfxfa/fpdfxfa_app.h"
-#include "../include/javascript/JS_Runtime.h"
#if _FX_OS_ == _FX_ANDROID_
#include "time.h"
@@ -381,7 +380,7 @@ IFXJS_Runtime* CPDFDoc_Environment::GetJSRuntime() {
if (!IsJSInitiated())
return NULL;
if (!m_pJSRuntime)
- m_pJSRuntime.reset(new CJS_Runtime(this));
+ m_pJSRuntime.reset(IFXJS_Runtime::Create(this));
return m_pJSRuntime.get();
}
diff --git a/fpdfsdk/src/javascript/Consts.cpp b/fpdfsdk/src/javascript/Consts.cpp
index fcdc5eabe2..3381978caf 100644
--- a/fpdfsdk/src/javascript/Consts.cpp
+++ b/fpdfsdk/src/javascript/Consts.cpp
@@ -4,11 +4,12 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+#include "Consts.h"
+
#include "../../include/javascript/IJavaScript.h"
-#include "../../include/javascript/JS_Define.h"
-#include "../../include/javascript/JS_Object.h"
-#include "../../include/javascript/JS_Value.h"
-#include "../../include/javascript/Consts.h"
+#include "JS_Define.h"
+#include "JS_Object.h"
+#include "JS_Value.h"
/* ------------------------------ border ------------------------------ */
diff --git a/fpdfsdk/include/javascript/Consts.h b/fpdfsdk/src/javascript/Consts.h
index c6abd8549a..a1d36f8877 100644
--- a/fpdfsdk/include/javascript/Consts.h
+++ b/fpdfsdk/src/javascript/Consts.h
@@ -4,8 +4,8 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef FPDFSDK_INCLUDE_JAVASCRIPT_CONSTS_H_
-#define FPDFSDK_INCLUDE_JAVASCRIPT_CONSTS_H_
+#ifndef FPDFSDK_SRC_JAVASCRIPT_CONSTS_H_
+#define FPDFSDK_SRC_JAVASCRIPT_CONSTS_H_
#include "JS_Define.h"
@@ -113,4 +113,4 @@ class CJS_GlobalArrays : public CJS_Object {
static void DefineJSObjects(v8::Isolate* pIsolate);
};
-#endif // FPDFSDK_INCLUDE_JAVASCRIPT_CONSTS_H_
+#endif // FPDFSDK_SRC_JAVASCRIPT_CONSTS_H_
diff --git a/fpdfsdk/src/javascript/Document.cpp b/fpdfsdk/src/javascript/Document.cpp
index 599d27fb79..9a569af859 100644
--- a/fpdfsdk/src/javascript/Document.cpp
+++ b/fpdfsdk/src/javascript/Document.cpp
@@ -4,20 +4,21 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#include "../../include/javascript/IJavaScript.h"
-#include "../../include/javascript/JS_Define.h"
-#include "../../include/javascript/JS_Object.h"
-#include "../../include/javascript/JS_Value.h"
-#include "../../include/javascript/Document.h"
-#include "../../include/javascript/JS_EventHandler.h"
-#include "../../include/javascript/JS_Context.h"
-#include "../../include/javascript/JS_Runtime.h"
-#include "../../include/javascript/app.h"
-#include "../../include/javascript/Field.h"
-#include "../../include/javascript/Icon.h"
-#include "../../include/javascript/resource.h"
+#include "Document.h"
#include "../../../third_party/base/numerics/safe_math.h"
+#include "../../include/fsdk_mgr.h" // For CPDFDoc_Environment.
+#include "../../include/javascript/IJavaScript.h"
+#include "Field.h"
+#include "Icon.h"
+#include "JS_Context.h"
+#include "JS_Define.h"
+#include "JS_EventHandler.h"
+#include "JS_Object.h"
+#include "JS_Runtime.h"
+#include "JS_Value.h"
+#include "app.h"
+#include "resource.h"
static v8::Isolate* GetIsolate(IFXJS_Context* cc) {
CJS_Context* pContext = (CJS_Context*)cc;
diff --git a/fpdfsdk/include/javascript/Document.h b/fpdfsdk/src/javascript/Document.h
index 4e60364444..65b2764d57 100644
--- a/fpdfsdk/include/javascript/Document.h
+++ b/fpdfsdk/src/javascript/Document.h
@@ -4,8 +4,8 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef FPDFSDK_INCLUDE_JAVASCRIPT_DOCUMENT_H_
-#define FPDFSDK_INCLUDE_JAVASCRIPT_DOCUMENT_H_
+#ifndef FPDFSDK_SRC_JAVASCRIPT_DOCUMENT_H_
+#define FPDFSDK_SRC_JAVASCRIPT_DOCUMENT_H_
#include "JS_Define.h"
@@ -404,4 +404,4 @@ class CJS_Document : public CJS_Object {
JS_STATIC_METHOD(mailDoc, Document);
};
-#endif // FPDFSDK_INCLUDE_JAVASCRIPT_DOCUMENT_H_
+#endif // FPDFSDK_SRC_JAVASCRIPT_DOCUMENT_H_
diff --git a/fpdfsdk/src/javascript/Field.cpp b/fpdfsdk/src/javascript/Field.cpp
index 7d2c7693a0..2a631dce39 100644
--- a/fpdfsdk/src/javascript/Field.cpp
+++ b/fpdfsdk/src/javascript/Field.cpp
@@ -4,18 +4,20 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+#include "Field.h"
+
+#include "../../include/fsdk_mgr.h" // For CPDFDoc_Environment.
#include "../../include/javascript/IJavaScript.h"
-#include "../../include/javascript/JS_Define.h"
-#include "../../include/javascript/JS_Object.h"
-#include "../../include/javascript/JS_Value.h"
-#include "../../include/javascript/Field.h"
-#include "../../include/javascript/JS_EventHandler.h"
-#include "../../include/javascript/JS_Context.h"
-#include "../../include/javascript/JS_Runtime.h"
-#include "../../include/javascript/Document.h"
-#include "../../include/javascript/color.h"
-#include "../../include/javascript/PublicMethods.h"
-#include "../../include/javascript/Icon.h"
+#include "Document.h"
+#include "Icon.h"
+#include "JS_Context.h"
+#include "JS_Define.h"
+#include "JS_EventHandler.h"
+#include "JS_Object.h"
+#include "JS_Runtime.h"
+#include "JS_Value.h"
+#include "PublicMethods.h"
+#include "color.h"
/* ---------------------- Field ---------------------- */
diff --git a/fpdfsdk/include/javascript/Field.h b/fpdfsdk/src/javascript/Field.h
index 851bc4fc16..a62bf39a9a 100644
--- a/fpdfsdk/include/javascript/Field.h
+++ b/fpdfsdk/src/javascript/Field.h
@@ -4,14 +4,15 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef FPDFSDK_INCLUDE_JAVASCRIPT_FIELD_H_
-#define FPDFSDK_INCLUDE_JAVASCRIPT_FIELD_H_
+#ifndef FPDFSDK_SRC_JAVASCRIPT_FIELD_H_
+#define FPDFSDK_SRC_JAVASCRIPT_FIELD_H_
#include <string> // For std::wstring.
-#include "../pdfwindow/PWL_Wnd.h" // For CPWL_Color.
+#include "../../include/pdfwindow/PWL_Wnd.h" // For CPWL_Color.
#include "JS_Define.h"
+class CPDFSDK_Widget;
class Document;
enum FIELD_PROP {
@@ -621,4 +622,4 @@ class CJS_Field : public CJS_Object {
JS_STATIC_METHOD(signatureValidate, Field);
};
-#endif // FPDFSDK_INCLUDE_JAVASCRIPT_FIELD_H_
+#endif // FPDFSDK_SRC_JAVASCRIPT_FIELD_H_
diff --git a/fpdfsdk/src/javascript/Icon.cpp b/fpdfsdk/src/javascript/Icon.cpp
index 4468fac90e..044a38ee2e 100644
--- a/fpdfsdk/src/javascript/Icon.cpp
+++ b/fpdfsdk/src/javascript/Icon.cpp
@@ -4,11 +4,12 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+#include "Icon.h"
+
#include "../../include/javascript/IJavaScript.h"
-#include "../../include/javascript/JS_Define.h"
-#include "../../include/javascript/JS_Object.h"
-#include "../../include/javascript/JS_Value.h"
-#include "../../include/javascript/Icon.h"
+#include "JS_Define.h"
+#include "JS_Object.h"
+#include "JS_Value.h"
/* ---------------------- Icon ---------------------- */
diff --git a/fpdfsdk/include/javascript/Icon.h b/fpdfsdk/src/javascript/Icon.h
index 9b6d21b985..b03048b47b 100644
--- a/fpdfsdk/include/javascript/Icon.h
+++ b/fpdfsdk/src/javascript/Icon.h
@@ -4,8 +4,8 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef FPDFSDK_INCLUDE_JAVASCRIPT_ICON_H_
-#define FPDFSDK_INCLUDE_JAVASCRIPT_ICON_H_
+#ifndef FPDFSDK_SRC_JAVASCRIPT_ICON_H_
+#define FPDFSDK_SRC_JAVASCRIPT_ICON_H_
#include "JS_Define.h"
@@ -36,4 +36,4 @@ class CJS_Icon : public CJS_Object {
JS_STATIC_PROP(name, Icon);
};
-#endif // FPDFSDK_INCLUDE_JAVASCRIPT_ICON_H_
+#endif // FPDFSDK_SRC_JAVASCRIPT_ICON_H_
diff --git a/fpdfsdk/src/javascript/JS_Context.cpp b/fpdfsdk/src/javascript/JS_Context.cpp
index 44756b628d..4769dac4f7 100644
--- a/fpdfsdk/src/javascript/JS_Context.cpp
+++ b/fpdfsdk/src/javascript/JS_Context.cpp
@@ -4,11 +4,12 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+#include "JS_Context.h"
+
#include "../../include/javascript/IJavaScript.h"
-#include "../../include/javascript/JS_Context.h"
-#include "../../include/javascript/JS_EventHandler.h"
-#include "../../include/javascript/JS_Runtime.h"
-#include "../../include/javascript/resource.h"
+#include "JS_EventHandler.h"
+#include "JS_Runtime.h"
+#include "resource.h"
/* -------------------------- CJS_Context -------------------------- */
diff --git a/fpdfsdk/include/javascript/JS_Context.h b/fpdfsdk/src/javascript/JS_Context.h
index d5b1064cfc..b1e1bcee2c 100644
--- a/fpdfsdk/include/javascript/JS_Context.h
+++ b/fpdfsdk/src/javascript/JS_Context.h
@@ -4,12 +4,12 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef FPDFSDK_INCLUDE_JAVASCRIPT_JS_CONTEXT_H_
-#define FPDFSDK_INCLUDE_JAVASCRIPT_JS_CONTEXT_H_
+#ifndef FPDFSDK_SRC_JAVASCRIPT_JS_CONTEXT_H_
+#define FPDFSDK_SRC_JAVASCRIPT_JS_CONTEXT_H_
#include "../../../core/include/fxcrt/fx_system.h"
#include "../../../core/include/fxcrt/fx_string.h"
-#include "IJavaScript.h"
+#include "../../include/javascript/IJavaScript.h"
class CJS_EventHandler;
class CJS_Runtime;
@@ -134,4 +134,4 @@ class CJS_Context : public IFXJS_Context {
FX_BOOL m_bMsgBoxEnable;
};
-#endif // FPDFSDK_INCLUDE_JAVASCRIPT_JS_CONTEXT_H_
+#endif // FPDFSDK_SRC_JAVASCRIPT_JS_CONTEXT_H_
diff --git a/fpdfsdk/include/javascript/JS_Define.h b/fpdfsdk/src/javascript/JS_Define.h
index e91ce03d30..8c00ba593a 100644
--- a/fpdfsdk/include/javascript/JS_Define.h
+++ b/fpdfsdk/src/javascript/JS_Define.h
@@ -4,10 +4,10 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef FPDFSDK_INCLUDE_JAVASCRIPT_JS_DEFINE_H_
-#define FPDFSDK_INCLUDE_JAVASCRIPT_JS_DEFINE_H_
+#ifndef FPDFSDK_SRC_JAVASCRIPT_JS_DEFINE_H_
+#define FPDFSDK_SRC_JAVASCRIPT_JS_DEFINE_H_
-#include "../jsapi/fxjs_v8.h"
+#include "../../include/jsapi/fxjs_v8.h"
#include "resource.h"
#include "JS_Object.h"
#include "JS_Value.h"
@@ -49,10 +49,11 @@ struct JSMethodSpec {
#define BEGIN_JS_STATIC_PROP(js_class_name) \
JSPropertySpec js_class_name::JS_Class_Properties[] = {
-#define JS_STATIC_PROP_ENTRY(prop_name) \
- { \
- JS_WIDESTRING(prop_name), get_##prop_name##_static, set_##prop_name##_static \
- } \
+#define JS_STATIC_PROP_ENTRY(prop_name) \
+ { \
+ JS_WIDESTRING(prop_name), get_##prop_name##_static, \
+ set_##prop_name##_static \
+ } \
,
#define END_JS_STATIC_PROP() \
{ 0, 0, 0 } \
@@ -475,4 +476,4 @@ void JSGlobalFunc(const char* func_name_string,
CJS_Value::Type GET_VALUE_TYPE(v8::Local<v8::Value> p);
-#endif // FPDFSDK_INCLUDE_JAVASCRIPT_JS_DEFINE_H_
+#endif // FPDFSDK_SRC_JAVASCRIPT_JS_DEFINE_H_
diff --git a/fpdfsdk/src/javascript/JS_EventHandler.cpp b/fpdfsdk/src/javascript/JS_EventHandler.cpp
index 64a6168e83..42d61f4c1e 100644
--- a/fpdfsdk/src/javascript/JS_EventHandler.cpp
+++ b/fpdfsdk/src/javascript/JS_EventHandler.cpp
@@ -4,15 +4,16 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+#include "JS_EventHandler.h"
+
#include "../../include/javascript/IJavaScript.h"
-#include "../../include/javascript/JS_EventHandler.h"
-#include "../../include/javascript/JS_Context.h"
-#include "../../include/javascript/JS_Runtime.h"
-#include "../../include/javascript/JS_Define.h"
-#include "../../include/javascript/JS_Object.h"
-#include "../../include/javascript/JS_Value.h"
-#include "../../include/javascript/Document.h"
-#include "../../include/javascript/Field.h"
+#include "Document.h"
+#include "Field.h"
+#include "JS_Context.h"
+#include "JS_Define.h"
+#include "JS_Object.h"
+#include "JS_Runtime.h"
+#include "JS_Value.h"
/* ---------------------------- CJS_EventHandler ---------------------------- */
diff --git a/fpdfsdk/include/javascript/JS_EventHandler.h b/fpdfsdk/src/javascript/JS_EventHandler.h
index e03904897d..5b67ec4baf 100644
--- a/fpdfsdk/include/javascript/JS_EventHandler.h
+++ b/fpdfsdk/src/javascript/JS_EventHandler.h
@@ -4,8 +4,8 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef FPDFSDK_INCLUDE_JAVASCRIPT_JS_EVENTHANDLER_H_
-#define FPDFSDK_INCLUDE_JAVASCRIPT_JS_EVENTHANDLER_H_
+#ifndef FPDFSDK_SRC_JAVASCRIPT_JS_EVENTHANDLER_H_
+#define FPDFSDK_SRC_JAVASCRIPT_JS_EVENTHANDLER_H_
#include "../../../core/include/fxcrt/fx_string.h"
#include "../../../core/include/fxcrt/fx_system.h"
@@ -217,4 +217,4 @@ class CJS_EventHandler {
CPDFSDK_Annot* m_pTargetAnnot;
};
-#endif // FPDFSDK_INCLUDE_JAVASCRIPT_JS_EVENTHANDLER_H_
+#endif // FPDFSDK_SRC_JAVASCRIPT_JS_EVENTHANDLER_H_
diff --git a/fpdfsdk/src/javascript/JS_GlobalData.cpp b/fpdfsdk/src/javascript/JS_GlobalData.cpp
index e6d21e296a..e13b50f5ef 100644
--- a/fpdfsdk/src/javascript/JS_GlobalData.cpp
+++ b/fpdfsdk/src/javascript/JS_GlobalData.cpp
@@ -4,9 +4,10 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+#include "JS_GlobalData.h"
+
#include "../../../core/include/fdrm/fx_crypt.h"
#include "../../include/javascript/IJavaScript.h"
-#include "../../include/javascript/JS_GlobalData.h"
#define JS_MAXGLOBALDATA (1024 * 4 - 8)
diff --git a/fpdfsdk/include/javascript/JS_GlobalData.h b/fpdfsdk/src/javascript/JS_GlobalData.h
index 644e0d80fc..b174a8d76e 100644
--- a/fpdfsdk/include/javascript/JS_GlobalData.h
+++ b/fpdfsdk/src/javascript/JS_GlobalData.h
@@ -4,8 +4,8 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef FPDFSDK_INCLUDE_JAVASCRIPT_JS_GLOBALDATA_H_
-#define FPDFSDK_INCLUDE_JAVASCRIPT_JS_GLOBALDATA_H_
+#ifndef FPDFSDK_SRC_JAVASCRIPT_JS_GLOBALDATA_H_
+#define FPDFSDK_SRC_JAVASCRIPT_JS_GLOBALDATA_H_
#include "../../../core/include/fxcrt/fx_basic.h"
@@ -105,4 +105,4 @@ class CJS_GlobalData {
CPDFDoc_Environment* m_pApp;
};
-#endif // FPDFSDK_INCLUDE_JAVASCRIPT_JS_GLOBALDATA_H_
+#endif // FPDFSDK_SRC_JAVASCRIPT_JS_GLOBALDATA_H_
diff --git a/fpdfsdk/src/javascript/JS_Object.cpp b/fpdfsdk/src/javascript/JS_Object.cpp
index 7898f48516..0556c4ea47 100644
--- a/fpdfsdk/src/javascript/JS_Object.cpp
+++ b/fpdfsdk/src/javascript/JS_Object.cpp
@@ -4,10 +4,12 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+#include "JS_Object.h"
+
+#include "../../include/fsdk_mgr.h" // For CPDFDoc_Environment.
#include "../../include/javascript/IJavaScript.h"
-#include "../../include/javascript/JS_Context.h"
-#include "../../include/javascript/JS_Define.h"
-#include "../../include/javascript/JS_Object.h"
+#include "JS_Context.h"
+#include "JS_Define.h"
namespace {
diff --git a/fpdfsdk/include/javascript/JS_Object.h b/fpdfsdk/src/javascript/JS_Object.h
index 6116a83d17..82d1da9ee9 100644
--- a/fpdfsdk/include/javascript/JS_Object.h
+++ b/fpdfsdk/src/javascript/JS_Object.h
@@ -4,23 +4,20 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef FPDFSDK_INCLUDE_JAVASCRIPT_JS_OBJECT_H_
-#define FPDFSDK_INCLUDE_JAVASCRIPT_JS_OBJECT_H_
+#ifndef FPDFSDK_SRC_JAVASCRIPT_JS_OBJECT_H_
+#define FPDFSDK_SRC_JAVASCRIPT_JS_OBJECT_H_
#include <map>
#include "../../../third_party/base/nonstd_unique_ptr.h"
-
-#include "../fsdk_define.h" // For FX_UINT
-#include "../fsdk_mgr.h" // For CPDFDoc_Environment
-#include "../fx_systemhandler.h" // For IFX_SystemHandler
-#include "../jsapi/fxjs_v8.h"
+#include "../../include/fsdk_define.h" // For FX_UINT
+#include "../../include/jsapi/fxjs_v8.h"
#include "JS_Runtime.h"
class CJS_Context;
class CJS_Object;
class CJS_Timer;
-
+class CPDFDoc_Environment;
class CJS_EmbedObj {
public:
explicit CJS_EmbedObj(CJS_Object* pJSObject);
@@ -116,4 +113,4 @@ class CJS_Timer : public CJS_Runtime::Observer {
CPDFDoc_Environment* const m_pApp;
};
-#endif // FPDFSDK_INCLUDE_JAVASCRIPT_JS_OBJECT_H_
+#endif // FPDFSDK_SRC_JAVASCRIPT_JS_OBJECT_H_
diff --git a/fpdfsdk/src/javascript/JS_Runtime.cpp b/fpdfsdk/src/javascript/JS_Runtime.cpp
index 49d235cbee..563576a9d6 100644
--- a/fpdfsdk/src/javascript/JS_Runtime.cpp
+++ b/fpdfsdk/src/javascript/JS_Runtime.cpp
@@ -4,32 +4,38 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#include "../../include/javascript/IJavaScript.h"
-#include "../../include/javascript/JS_EventHandler.h"
-#include "../../include/javascript/JS_Runtime.h"
-#include "../../include/javascript/JS_Context.h"
-#include "../../include/javascript/JS_Define.h"
-#include "../../include/javascript/JS_Object.h"
-#include "../../include/javascript/JS_Value.h"
-#include "../../include/javascript/app.h"
-#include "../../include/javascript/color.h"
-#include "../../include/javascript/Consts.h"
-#include "../../include/javascript/Document.h"
-#include "../../include/javascript/event.h"
-#include "../../include/javascript/Field.h"
-#include "../../include/javascript/Icon.h"
-#include "../../include/javascript/PublicMethods.h"
-#include "../../include/javascript/report.h"
-#include "../../include/javascript/util.h"
-#include "../../include/javascript/JS_GlobalData.h"
-#include "../../include/javascript/global.h"
-#include "../../include/javascript/console.h"
-#include "../../include/fpdfxfa/fpdfxfa_app.h"
+#include "JS_Runtime.h"
+
#include "../../../xfa/src/fxjse/src/value.h"
+#include "../../include/fpdfxfa/fpdfxfa_app.h"
+#include "../../include/fsdk_mgr.h" // For CPDFDoc_Environment.
+#include "../../include/javascript/IJavaScript.h"
+#include "Consts.h"
+#include "Document.h"
+#include "Field.h"
+#include "Icon.h"
+#include "JS_Context.h"
+#include "JS_Define.h"
+#include "JS_EventHandler.h"
+#include "JS_GlobalData.h"
+#include "JS_Object.h"
+#include "JS_Value.h"
+#include "PublicMethods.h"
+#include "app.h"
+#include "color.h"
+#include "console.h"
+#include "event.h"
+#include "global.h"
+#include "report.h"
+#include "util.h"
/* ------------------------------ CJS_Runtime ------------------------------ */
v8::Global<v8::ObjectTemplate>& _getGlobalObjectTemplate(v8::Isolate* pIsolate);
+IFXJS_Runtime* IFXJS_Runtime::Create(CPDFDoc_Environment* pEnv) {
+ return new CJS_Runtime(pEnv);
+}
+
CJS_Runtime::CJS_Runtime(CPDFDoc_Environment* pApp)
: m_pApp(pApp),
m_pDocument(NULL),
diff --git a/fpdfsdk/include/javascript/JS_Runtime.h b/fpdfsdk/src/javascript/JS_Runtime.h
index 578da2e092..0576980233 100644
--- a/fpdfsdk/include/javascript/JS_Runtime.h
+++ b/fpdfsdk/src/javascript/JS_Runtime.h
@@ -4,16 +4,16 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef FPDFSDK_INCLUDE_JAVASCRIPT_JS_RUNTIME_H_
-#define FPDFSDK_INCLUDE_JAVASCRIPT_JS_RUNTIME_H_
+#ifndef FPDFSDK_SRC_JAVASCRIPT_JS_RUNTIME_H_
+#define FPDFSDK_SRC_JAVASCRIPT_JS_RUNTIME_H_
#include <set>
#include <utility>
#include "../../../third_party/base/nonstd_unique_ptr.h"
#include "../../../core/include/fxcrt/fx_basic.h"
-#include "../jsapi/fxjs_v8.h"
-#include "IJavaScript.h"
+#include "../../include/javascript/IJavaScript.h"
+#include "../../include/jsapi/fxjs_v8.h"
#include "JS_EventHandler.h"
class CJS_Context;
@@ -76,4 +76,4 @@ class CJS_Runtime : public IFXJS_Runtime {
std::set<Observer*> m_observers;
};
-#endif // FPDFSDK_INCLUDE_JAVASCRIPT_JS_RUNTIME_H_
+#endif // FPDFSDK_SRC_JAVASCRIPT_JS_RUNTIME_H_
diff --git a/fpdfsdk/src/javascript/JS_Value.cpp b/fpdfsdk/src/javascript/JS_Value.cpp
index f4aecba94e..94b5ff6e8c 100644
--- a/fpdfsdk/src/javascript/JS_Value.cpp
+++ b/fpdfsdk/src/javascript/JS_Value.cpp
@@ -4,14 +4,15 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+#include "JS_Value.h"
+
#include <time.h>
#include <cmath>
#include <limits>
-#include "../../include/javascript/JS_Define.h"
-#include "../../include/javascript/JS_Object.h"
-#include "../../include/javascript/JS_Value.h"
-#include "../../include/javascript/Document.h"
+#include "Document.h"
+#include "JS_Define.h"
+#include "JS_Object.h"
static const FX_DWORD g_nan[2] = {0, 0x7FF80000};
static double GetNan() {
diff --git a/fpdfsdk/include/javascript/JS_Value.h b/fpdfsdk/src/javascript/JS_Value.h
index 384e772572..fdcc66279f 100644
--- a/fpdfsdk/include/javascript/JS_Value.h
+++ b/fpdfsdk/src/javascript/JS_Value.h
@@ -4,11 +4,11 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef FPDFSDK_INCLUDE_JAVASCRIPT_JS_VALUE_H_
-#define FPDFSDK_INCLUDE_JAVASCRIPT_JS_VALUE_H_
+#ifndef FPDFSDK_SRC_JAVASCRIPT_JS_VALUE_H_
+#define FPDFSDK_SRC_JAVASCRIPT_JS_VALUE_H_
#include "../../../core/include/fxcrt/fx_basic.h"
-#include "../jsapi/fxjs_v8.h"
+#include "../../include/jsapi/fxjs_v8.h"
class CJS_Array;
class CJS_Date;
@@ -215,4 +215,4 @@ double JS_MakeDate(double day, double time);
bool JS_PortIsNan(double d);
double JS_LocalTime(double d);
-#endif // FPDFSDK_INCLUDE_JAVASCRIPT_JS_VALUE_H_
+#endif // FPDFSDK_SRC_JAVASCRIPT_JS_VALUE_H_
diff --git a/fpdfsdk/src/javascript/PublicMethods.cpp b/fpdfsdk/src/javascript/PublicMethods.cpp
index 490c9e300f..f5686a7129 100644
--- a/fpdfsdk/src/javascript/PublicMethods.cpp
+++ b/fpdfsdk/src/javascript/PublicMethods.cpp
@@ -4,19 +4,20 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+#include "PublicMethods.h"
+
+#include "../../include/fsdk_mgr.h" // For CPDFDoc_Environment.
#include "../../include/javascript/IJavaScript.h"
-#include "../../include/javascript/JS_Define.h"
-#include "../../include/javascript/JS_Object.h"
-#include "../../include/javascript/JS_Value.h"
-#include "../../include/javascript/PublicMethods.h"
-#include "../../include/javascript/JS_EventHandler.h"
-#include "../../include/javascript/resource.h"
-#include "../../include/javascript/JS_Context.h"
-#include "../../include/javascript/JS_Value.h"
-#include "../../include/javascript/util.h"
-#include "../../include/javascript/Field.h"
-#include "../../include/javascript/color.h"
-#include "../../include/javascript/JS_Runtime.h"
+#include "Field.h"
+#include "JS_Context.h"
+#include "JS_Define.h"
+#include "JS_EventHandler.h"
+#include "JS_Object.h"
+#include "JS_Runtime.h"
+#include "JS_Value.h"
+#include "color.h"
+#include "resource.h"
+#include "util.h"
static v8::Isolate* GetIsolate(IFXJS_Context* cc) {
CJS_Context* pContext = (CJS_Context*)cc;
diff --git a/fpdfsdk/include/javascript/PublicMethods.h b/fpdfsdk/src/javascript/PublicMethods.h
index 02ace4a4c4..47885b428b 100644
--- a/fpdfsdk/include/javascript/PublicMethods.h
+++ b/fpdfsdk/src/javascript/PublicMethods.h
@@ -4,8 +4,8 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef FPDFSDK_INCLUDE_JAVASCRIPT_PUBLICMETHODS_H_
-#define FPDFSDK_INCLUDE_JAVASCRIPT_PUBLICMETHODS_H_
+#ifndef FPDFSDK_SRC_JAVASCRIPT_PUBLICMETHODS_H_
+#define FPDFSDK_SRC_JAVASCRIPT_PUBLICMETHODS_H_
#include "JS_Define.h"
@@ -182,4 +182,4 @@ class CJS_PublicMethods : public CJS_Object {
static CJS_Array AF_MakeArrayFromList(v8::Isolate* isolate, CJS_Value val);
};
-#endif // FPDFSDK_INCLUDE_JAVASCRIPT_PUBLICMETHODS_H_
+#endif // FPDFSDK_SRC_JAVASCRIPT_PUBLICMETHODS_H_
diff --git a/fpdfsdk/src/javascript/app.cpp b/fpdfsdk/src/javascript/app.cpp
index fcaffa4e7f..892712243a 100644
--- a/fpdfsdk/src/javascript/app.cpp
+++ b/fpdfsdk/src/javascript/app.cpp
@@ -4,17 +4,19 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+#include "app.h"
+
#include "../../../third_party/base/nonstd_unique_ptr.h"
+#include "../../include/fsdk_mgr.h" // For CPDFDoc_Environment.
#include "../../include/javascript/IJavaScript.h"
-#include "../../include/javascript/JS_Define.h"
-#include "../../include/javascript/JS_Object.h"
-#include "../../include/javascript/JS_Value.h"
-#include "../../include/javascript/app.h"
-#include "../../include/javascript/JS_EventHandler.h"
-#include "../../include/javascript/resource.h"
-#include "../../include/javascript/JS_Context.h"
-#include "../../include/javascript/JS_Runtime.h"
-#include "../../include/javascript/Document.h"
+#include "Document.h"
+#include "JS_Context.h"
+#include "JS_Define.h"
+#include "JS_EventHandler.h"
+#include "JS_Object.h"
+#include "JS_Runtime.h"
+#include "JS_Value.h"
+#include "resource.h"
static v8::Isolate* GetIsolate(IFXJS_Context* cc) {
CJS_Context* pContext = (CJS_Context*)cc;
diff --git a/fpdfsdk/include/javascript/app.h b/fpdfsdk/src/javascript/app.h
index 1ab02c5eac..7824a1e99e 100644
--- a/fpdfsdk/include/javascript/app.h
+++ b/fpdfsdk/src/javascript/app.h
@@ -4,8 +4,8 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef FPDFSDK_INCLUDE_JAVASCRIPT_APP_H_
-#define FPDFSDK_INCLUDE_JAVASCRIPT_APP_H_
+#ifndef FPDFSDK_SRC_JAVASCRIPT_APP_H_
+#define FPDFSDK_SRC_JAVASCRIPT_APP_H_
#include "JS_Define.h"
@@ -215,4 +215,4 @@ class CJS_App : public CJS_Object {
JS_STATIC_METHOD(setTimeOut, app);
};
-#endif // FPDFSDK_INCLUDE_JAVASCRIPT_APP_H_
+#endif // FPDFSDK_SRC_JAVASCRIPT_APP_H_
diff --git a/fpdfsdk/src/javascript/color.cpp b/fpdfsdk/src/javascript/color.cpp
index cac390791f..da6fc60076 100644
--- a/fpdfsdk/src/javascript/color.cpp
+++ b/fpdfsdk/src/javascript/color.cpp
@@ -4,15 +4,15 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#include "../../include/javascript/color.h"
+#include "color.h"
#include "../../include/javascript/IJavaScript.h"
-#include "../../include/javascript/JS_Define.h"
-#include "../../include/javascript/JS_Object.h"
-#include "../../include/javascript/JS_Value.h"
-#include "../../include/javascript/JS_EventHandler.h"
-#include "../../include/javascript/JS_Context.h"
-#include "../../include/javascript/JS_Runtime.h"
+#include "JS_Define.h"
+#include "JS_Object.h"
+#include "JS_Value.h"
+#include "JS_EventHandler.h"
+#include "JS_Context.h"
+#include "JS_Runtime.h"
static v8::Isolate* GetIsolate(IFXJS_Context* cc) {
CJS_Context* pContext = (CJS_Context*)cc;
diff --git a/fpdfsdk/include/javascript/color.h b/fpdfsdk/src/javascript/color.h
index 8008575a70..9dec19174e 100644
--- a/fpdfsdk/include/javascript/color.h
+++ b/fpdfsdk/src/javascript/color.h
@@ -4,10 +4,10 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef FPDFSDK_INCLUDE_JAVASCRIPT_COLOR_H_
-#define FPDFSDK_INCLUDE_JAVASCRIPT_COLOR_H_
+#ifndef FPDFSDK_SRC_JAVASCRIPT_COLOR_H_
+#define FPDFSDK_SRC_JAVASCRIPT_COLOR_H_
-#include "../pdfwindow/PWL_Wnd.h" // For CPWL_Color.
+#include "../../include/pdfwindow/PWL_Wnd.h" // For CPWL_Color.
#include "JS_Define.h"
class color : public CJS_EmbedObj {
@@ -82,4 +82,4 @@ class CJS_Color : public CJS_Object {
JS_STATIC_METHOD(equal, color);
};
-#endif // FPDFSDK_INCLUDE_JAVASCRIPT_COLOR_H_
+#endif // FPDFSDK_SRC_JAVASCRIPT_COLOR_H_
diff --git a/fpdfsdk/src/javascript/console.cpp b/fpdfsdk/src/javascript/console.cpp
index 519cecc5b4..a44d239552 100644
--- a/fpdfsdk/src/javascript/console.cpp
+++ b/fpdfsdk/src/javascript/console.cpp
@@ -4,13 +4,14 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+#include "console.h"
+
#include "../../include/javascript/IJavaScript.h"
-#include "../../include/javascript/JS_Define.h"
-#include "../../include/javascript/JS_Object.h"
-#include "../../include/javascript/JS_Value.h"
-#include "../../include/javascript/console.h"
-#include "../../include/javascript/JS_EventHandler.h"
-#include "../../include/javascript/JS_Context.h"
+#include "JS_Define.h"
+#include "JS_Object.h"
+#include "JS_Value.h"
+#include "JS_EventHandler.h"
+#include "JS_Context.h"
/* ------------------------ console ------------------------ */
diff --git a/fpdfsdk/include/javascript/console.h b/fpdfsdk/src/javascript/console.h
index 1571d109f1..747bc15098 100644
--- a/fpdfsdk/include/javascript/console.h
+++ b/fpdfsdk/src/javascript/console.h
@@ -4,8 +4,8 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef FPDFSDK_INCLUDE_JAVASCRIPT_CONSOLE_H_
-#define FPDFSDK_INCLUDE_JAVASCRIPT_CONSOLE_H_
+#ifndef FPDFSDK_SRC_JAVASCRIPT_CONSOLE_H_
+#define FPDFSDK_SRC_JAVASCRIPT_CONSOLE_H_
#include "JS_Define.h"
@@ -46,4 +46,4 @@ class CJS_Console : public CJS_Object {
JS_STATIC_METHOD(show, console);
};
-#endif // FPDFSDK_INCLUDE_JAVASCRIPT_CONSOLE_H_
+#endif // FPDFSDK_SRC_JAVASCRIPT_CONSOLE_H_
diff --git a/fpdfsdk/src/javascript/event.cpp b/fpdfsdk/src/javascript/event.cpp
index 7031be8c38..0d02503c96 100644
--- a/fpdfsdk/src/javascript/event.cpp
+++ b/fpdfsdk/src/javascript/event.cpp
@@ -4,14 +4,15 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+#include "event.h"
+
#include "../../include/javascript/IJavaScript.h"
-#include "../../include/javascript/JS_Define.h"
-#include "../../include/javascript/JS_Object.h"
-#include "../../include/javascript/JS_Value.h"
-#include "../../include/javascript/JS_EventHandler.h"
-#include "../../include/javascript/JS_Context.h"
-#include "../../include/javascript/event.h"
-#include "../../include/javascript/Field.h"
+#include "JS_Define.h"
+#include "JS_Object.h"
+#include "JS_Value.h"
+#include "JS_EventHandler.h"
+#include "JS_Context.h"
+#include "Field.h"
/* -------------------------- event -------------------------- */
diff --git a/fpdfsdk/include/javascript/event.h b/fpdfsdk/src/javascript/event.h
index a934d54e62..29ff3bc290 100644
--- a/fpdfsdk/include/javascript/event.h
+++ b/fpdfsdk/src/javascript/event.h
@@ -4,8 +4,8 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef FPDFSDK_INCLUDE_JAVASCRIPT_EVENT_H_
-#define FPDFSDK_INCLUDE_JAVASCRIPT_EVENT_H_
+#ifndef FPDFSDK_SRC_JAVASCRIPT_EVENT_H_
+#define FPDFSDK_SRC_JAVASCRIPT_EVENT_H_
#include "JS_Define.h"
@@ -86,4 +86,4 @@ class CJS_Event : public CJS_Object {
JS_STATIC_PROP(willCommit, event);
};
-#endif // FPDFSDK_INCLUDE_JAVASCRIPT_EVENT_H_
+#endif // FPDFSDK_SRC_JAVASCRIPT_EVENT_H_
diff --git a/fpdfsdk/src/javascript/global.cpp b/fpdfsdk/src/javascript/global.cpp
index c4f208f3b5..cd4545d3cb 100644
--- a/fpdfsdk/src/javascript/global.cpp
+++ b/fpdfsdk/src/javascript/global.cpp
@@ -4,17 +4,18 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+#include "global.h"
+
#include "../../../core/include/fxcrt/fx_ext.h"
-#include "../../include/javascript/IJavaScript.h"
-#include "../../include/javascript/JS_Context.h"
-#include "../../include/javascript/JS_Define.h"
-#include "../../include/javascript/JS_EventHandler.h"
-#include "../../include/javascript/JS_GlobalData.h"
-#include "../../include/javascript/JS_Object.h"
-#include "../../include/javascript/JS_Value.h"
-#include "../../include/javascript/global.h"
#include "../../include/fpdfxfa/fpdfxfa_app.h"
-#include "../../include/javascript/resource.h"
+#include "../../include/javascript/IJavaScript.h"
+#include "JS_Context.h"
+#include "JS_Define.h"
+#include "JS_EventHandler.h"
+#include "JS_GlobalData.h"
+#include "JS_Object.h"
+#include "JS_Value.h"
+#include "resource.h"
/* ---------------------------- global ---------------------------- */
diff --git a/fpdfsdk/include/javascript/global.h b/fpdfsdk/src/javascript/global.h
index 10300a25ab..03b6e76bc8 100644
--- a/fpdfsdk/include/javascript/global.h
+++ b/fpdfsdk/src/javascript/global.h
@@ -4,8 +4,8 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef FPDFSDK_INCLUDE_JAVASCRIPT_GLOBAL_H_
-#define FPDFSDK_INCLUDE_JAVASCRIPT_GLOBAL_H_
+#ifndef FPDFSDK_SRC_JAVASCRIPT_GLOBAL_H_
+#define FPDFSDK_SRC_JAVASCRIPT_GLOBAL_H_
#include <map>
@@ -90,4 +90,4 @@ class CJS_Global : public CJS_Object {
JS_SPECIAL_STATIC_METHOD(setPersistent, JSGlobalAlternate, global);
};
-#endif // FPDFSDK_INCLUDE_JAVASCRIPT_GLOBAL_H_
+#endif // FPDFSDK_SRC_JAVASCRIPT_GLOBAL_H_
diff --git a/fpdfsdk/src/javascript/report.cpp b/fpdfsdk/src/javascript/report.cpp
index d3877924c3..629b74972c 100644
--- a/fpdfsdk/src/javascript/report.cpp
+++ b/fpdfsdk/src/javascript/report.cpp
@@ -4,11 +4,12 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+#include "report.h"
+
#include "../../include/javascript/IJavaScript.h"
-#include "../../include/javascript/JS_Define.h"
-#include "../../include/javascript/JS_Object.h"
-#include "../../include/javascript/JS_Value.h"
-#include "../../include/javascript/report.h"
+#include "JS_Define.h"
+#include "JS_Object.h"
+#include "JS_Value.h"
/* ---------------------- report ---------------------- */
diff --git a/fpdfsdk/include/javascript/report.h b/fpdfsdk/src/javascript/report.h
index 5b17dabc50..0b4be6d6d7 100644
--- a/fpdfsdk/include/javascript/report.h
+++ b/fpdfsdk/src/javascript/report.h
@@ -4,8 +4,8 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef FPDFSDK_INCLUDE_JAVASCRIPT_REPORT_H_
-#define FPDFSDK_INCLUDE_JAVASCRIPT_REPORT_H_
+#ifndef FPDFSDK_SRC_JAVASCRIPT_REPORT_H_
+#define FPDFSDK_SRC_JAVASCRIPT_REPORT_H_
#include "JS_Define.h"
@@ -37,4 +37,4 @@ class CJS_Report : public CJS_Object {
JS_STATIC_METHOD(writeText, Report);
};
-#endif // FPDFSDK_INCLUDE_JAVASCRIPT_REPORT_H_
+#endif // FPDFSDK_SRC_JAVASCRIPT_REPORT_H_
diff --git a/fpdfsdk/src/javascript/resource.cpp b/fpdfsdk/src/javascript/resource.cpp
index 5b6bd48703..d99e7ce95a 100644
--- a/fpdfsdk/src/javascript/resource.cpp
+++ b/fpdfsdk/src/javascript/resource.cpp
@@ -4,7 +4,7 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#include "../../include/javascript/resource.h"
+#include "resource.h"
CFX_WideString JSGetStringFromID(CJS_Context* pContext, FX_UINT id) {
switch (id) {
diff --git a/fpdfsdk/include/javascript/resource.h b/fpdfsdk/src/javascript/resource.h
index 80629cf2ae..fcefcd486f 100644
--- a/fpdfsdk/include/javascript/resource.h
+++ b/fpdfsdk/src/javascript/resource.h
@@ -4,11 +4,11 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef FPDFSDK_INCLUDE_JAVASCRIPT_RESOURCE_H_
-#define FPDFSDK_INCLUDE_JAVASCRIPT_RESOURCE_H_
+#ifndef FPDFSDK_SRC_JAVASCRIPT_RESOURCE_H_
+#define FPDFSDK_SRC_JAVASCRIPT_RESOURCE_H_
#include "../../../core/include/fxcrt/fx_string.h" // For CFX_WideString.
-#include "../fsdk_define.h" // For FX_UINT.
+#include "../../include/fsdk_define.h" // For FX_UINT.
class CJS_Context;
@@ -36,4 +36,4 @@ CFX_WideString JSFormatErrorString(const char* class_name,
const char* property_name,
const CFX_WideString& details);
-#endif // FPDFSDK_INCLUDE_JAVASCRIPT_RESOURCE_H_
+#endif // FPDFSDK_SRC_JAVASCRIPT_RESOURCE_H_
diff --git a/fpdfsdk/src/javascript/util.cpp b/fpdfsdk/src/javascript/util.cpp
index 6afddf74b5..c83aa6f5bc 100644
--- a/fpdfsdk/src/javascript/util.cpp
+++ b/fpdfsdk/src/javascript/util.cpp
@@ -4,16 +4,17 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+#include "util.h"
+
#include "../../include/javascript/IJavaScript.h"
-#include "../../include/javascript/JS_Define.h"
-#include "../../include/javascript/JS_Object.h"
-#include "../../include/javascript/JS_Value.h"
-#include "../../include/javascript/util.h"
-#include "../../include/javascript/PublicMethods.h"
-#include "../../include/javascript/resource.h"
-#include "../../include/javascript/JS_Context.h"
-#include "../../include/javascript/JS_EventHandler.h"
-#include "../../include/javascript/JS_Runtime.h"
+#include "JS_Context.h"
+#include "JS_Define.h"
+#include "JS_EventHandler.h"
+#include "JS_Object.h"
+#include "JS_Runtime.h"
+#include "JS_Value.h"
+#include "PublicMethods.h"
+#include "resource.h"
#if _FX_OS_ == _FX_ANDROID_
#include <ctype.h>
diff --git a/fpdfsdk/include/javascript/util.h b/fpdfsdk/src/javascript/util.h
index d7a1ef7b8c..c88462c349 100644
--- a/fpdfsdk/include/javascript/util.h
+++ b/fpdfsdk/src/javascript/util.h
@@ -4,8 +4,8 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef FPDFSDK_INCLUDE_JAVASCRIPT_UTIL_H_
-#define FPDFSDK_INCLUDE_JAVASCRIPT_UTIL_H_
+#ifndef FPDFSDK_SRC_JAVASCRIPT_UTIL_H_
+#define FPDFSDK_SRC_JAVASCRIPT_UTIL_H_
#include <string> // For std::wstring.
@@ -65,4 +65,4 @@ class CJS_Util : public CJS_Object {
int64_t FX_atoi64(const char* nptr);
-#endif // FPDFSDK_INCLUDE_JAVASCRIPT_UTIL_H_
+#endif // FPDFSDK_SRC_JAVASCRIPT_UTIL_H_
diff --git a/fpdfsdk/src/jsapi/fxjs_v8_embeddertest.cpp b/fpdfsdk/src/jsapi/fxjs_v8_embeddertest.cpp
index 7f65badd9d..55eb9c8408 100644
--- a/fpdfsdk/src/jsapi/fxjs_v8_embeddertest.cpp
+++ b/fpdfsdk/src/jsapi/fxjs_v8_embeddertest.cpp
@@ -2,10 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "../../../third_party/base/nonstd_unique_ptr.h"
#include "../../../core/include/fpdfapi/fpdf_parser.h"
#include "../../../testing/embedder_test.h"
-#include "../../include/fsdk_mgr.h"
-#include "../../include/javascript/JS_Runtime.h"
#include "../../include/jsapi/fxjs_v8.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -50,7 +49,7 @@ class FXJSV8Embeddertest : public EmbedderTest {
private:
v8::Isolate* m_pIsolate;
v8::Global<v8::Context> m_pPersistentContext;
- nonstd::unique_ptr<v8::ArrayBuffer::Allocator> m_pAllocator;
+ nonstd::unique_ptr<FXJS_ArrayBufferAllocator> m_pAllocator;
};
TEST_F(FXJSV8Embeddertest, Getters) {
diff --git a/pdfium.gyp b/pdfium.gyp
index e20bd4ac20..cf19b018f0 100644
--- a/pdfium.gyp
+++ b/pdfium.gyp
@@ -704,46 +704,49 @@
],
'ldflags': [ '-L<(PRODUCT_DIR)',],
'sources': [
- 'fpdfsdk/include/javascript/app.h',
- 'fpdfsdk/include/javascript/color.h',
- 'fpdfsdk/include/javascript/console.h',
- 'fpdfsdk/include/javascript/Consts.h',
- 'fpdfsdk/include/javascript/Document.h',
- 'fpdfsdk/include/javascript/event.h',
- 'fpdfsdk/include/javascript/Field.h',
- 'fpdfsdk/include/javascript/global.h',
- 'fpdfsdk/include/javascript/Icon.h',
'fpdfsdk/include/javascript/IJavaScript.h',
- 'fpdfsdk/include/javascript/JS_Context.h',
- 'fpdfsdk/include/javascript/JS_Define.h',
- 'fpdfsdk/include/javascript/JS_EventHandler.h',
- 'fpdfsdk/include/javascript/JS_GlobalData.h',
- 'fpdfsdk/include/javascript/JS_Object.h',
- 'fpdfsdk/include/javascript/JS_Runtime.h',
- 'fpdfsdk/include/javascript/JS_Value.h',
- 'fpdfsdk/include/javascript/PublicMethods.h',
- 'fpdfsdk/include/javascript/report.h',
- 'fpdfsdk/include/javascript/resource.h',
- 'fpdfsdk/include/javascript/util.h',
'fpdfsdk/src/javascript/app.cpp',
'fpdfsdk/src/javascript/color.cpp',
'fpdfsdk/src/javascript/console.cpp',
'fpdfsdk/src/javascript/Consts.cpp',
+ 'fpdfsdk/src/javascript/Consts.h',
'fpdfsdk/src/javascript/Document.cpp',
- 'fpdfsdk/src/javascript/event.cpp',
+ 'fpdfsdk/src/javascript/Document.h',
'fpdfsdk/src/javascript/Field.cpp',
- 'fpdfsdk/src/javascript/global.cpp',
+ 'fpdfsdk/src/javascript/Field.h',
'fpdfsdk/src/javascript/Icon.cpp',
+ 'fpdfsdk/src/javascript/Icon.h',
'fpdfsdk/src/javascript/JS_Context.cpp',
+ 'fpdfsdk/src/javascript/JS_Context.h',
+ 'fpdfsdk/src/javascript/JS_Define.h',
'fpdfsdk/src/javascript/JS_EventHandler.cpp',
+ 'fpdfsdk/src/javascript/JS_EventHandler.h',
'fpdfsdk/src/javascript/JS_GlobalData.cpp',
+ 'fpdfsdk/src/javascript/JS_GlobalData.h',
'fpdfsdk/src/javascript/JS_Object.cpp',
+ 'fpdfsdk/src/javascript/JS_Object.h',
'fpdfsdk/src/javascript/JS_Runtime.cpp',
+ 'fpdfsdk/src/javascript/JS_Runtime.h',
'fpdfsdk/src/javascript/JS_Value.cpp',
+ 'fpdfsdk/src/javascript/JS_Value.h',
'fpdfsdk/src/javascript/PublicMethods.cpp',
+ 'fpdfsdk/src/javascript/PublicMethods.h',
+ 'fpdfsdk/src/javascript/app.cpp',
+ 'fpdfsdk/src/javascript/app.h',
+ 'fpdfsdk/src/javascript/color.cpp',
+ 'fpdfsdk/src/javascript/color.h',
+ 'fpdfsdk/src/javascript/console.cpp',
+ 'fpdfsdk/src/javascript/console.h',
+ 'fpdfsdk/src/javascript/event.cpp',
+ 'fpdfsdk/src/javascript/event.h',
+ 'fpdfsdk/src/javascript/global.cpp',
+ 'fpdfsdk/src/javascript/global.h',
'fpdfsdk/src/javascript/report.cpp',
+ 'fpdfsdk/src/javascript/report.h',
'fpdfsdk/src/javascript/resource.cpp',
+ 'fpdfsdk/src/javascript/resource.h',
'fpdfsdk/src/javascript/util.cpp',
+ 'fpdfsdk/src/javascript/util.h',
],
},
{
diff --git a/xfa/include/fxfa/fxfa.h b/xfa/include/fxfa/fxfa.h
index 5ccd1f206f..503909a1c4 100644
--- a/xfa/include/fxfa/fxfa.h
+++ b/xfa/include/fxfa/fxfa.h
@@ -7,26 +7,27 @@
#ifndef FXFA_H_
#define FXFA_H_
-class IFDE_XMLElement;
+class CFX_Graphics;
+class CPDF_Document;
class CXFA_Node;
class CXFA_NodeList;
class CXFA_WidgetAcc;
+class IFDE_XMLElement;
class IFWL_AdapterTimerMgr;
class IFX_Font;
-class CFX_Graphics;
-class IXFA_AppProvider;
class IXFA_App;
-class IXFA_FontMgr;
-class IXFA_DocProvider;
+class IXFA_AppProvider;
+class IXFA_ChecksumContext;
class IXFA_DocHandler;
+class IXFA_DocProvider;
class IXFA_DocView;
-class IXFA_PageViewRender;
+class IXFA_FontMgr;
+class IXFA_MenuHandler;
class IXFA_PageView;
+class IXFA_PageViewRender;
+class IXFA_WidgetAccIterator;
class IXFA_WidgetHandler;
class IXFA_WidgetIterator;
-class IXFA_MenuHandler;
-class IXFA_ChecksumContext;
-class IXFA_WidgetAccIterator;
class IXFA_Doc {
public:
diff --git a/xfa/include/fxfa/fxfa_objectacc.h b/xfa/include/fxfa/fxfa_objectacc.h
index f90fca35fa..3cef82b363 100644
--- a/xfa/include/fxfa/fxfa_objectacc.h
+++ b/xfa/include/fxfa/fxfa_objectacc.h
@@ -4,8 +4,11 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef _FXFA_NODEACC_H
-#define _FXFA_NODEACC_H
+#ifndef FXFA_OBJECTACC_H_
+#define FXFA_OBJECTACC_H_
+
+#include "../../../core/include/fxge/fx_dib.h" // For FX_ARGB.
+
class CXFA_Node;
class IFX_Locale;
class CXFA_Data;
@@ -841,4 +844,5 @@ class CXFA_Manifest : public CXFA_Data {
int32_t CountReives();
CFX_WideString GetRefContent(int32_t nIndex);
};
-#endif
+
+#endif // FXFA_OBJECTACC_H_