summaryrefslogtreecommitdiff
path: root/fpdfsdk
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-10-06 07:50:47 -0700
committerTom Sepez <tsepez@chromium.org>2015-10-06 07:50:47 -0700
commit5b3d0208723f21c50b9922bdc500c9d78c359a25 (patch)
treef381d6ee565cb981680a0e66d5f7c04efb9a22e8 /fpdfsdk
parent35902e725aa6cc83a317c3b6fdd1926b81b8e44b (diff)
downloadpdfium-5b3d0208723f21c50b9922bdc500c9d78c359a25.tar.xz
Make the vast majority of JS headers private to src/javascript.
The fpdfsdk/include/javascript/IJavascript.h is the sole API. This required moving a creaton method to it from JS_Runtime. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1389783002 .
Diffstat (limited to 'fpdfsdk')
-rw-r--r--fpdfsdk/include/javascript/IJavaScript.h4
-rw-r--r--fpdfsdk/src/fsdk_mgr.cpp3
-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.cpp44
-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.cpp17
-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
42 files changed, 242 insertions, 216 deletions
diff --git a/fpdfsdk/include/javascript/IJavaScript.h b/fpdfsdk/include/javascript/IJavaScript.h
index 3791b886c4..4aeb76065b 100644
--- a/fpdfsdk/include/javascript/IJavaScript.h
+++ b/fpdfsdk/include/javascript/IJavaScript.h
@@ -133,6 +133,7 @@ class IFXJS_Context {
class IFXJS_Runtime {
public:
+ static IFXJS_Runtime* Create(CPDFDoc_Environment* pEnv);
virtual ~IFXJS_Runtime() {}
virtual IFXJS_Context* NewContext() = 0;
@@ -140,6 +141,9 @@ class IFXJS_Runtime {
virtual IFXJS_Context* GetCurrentContext() = 0;
virtual void SetReaderDocument(CPDFSDK_Document* pReaderDoc) = 0;
virtual CPDFSDK_Document* GetReaderDocument() = 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 5b94aef600..6123dc8c9b 100644
--- a/fpdfsdk/src/fsdk_mgr.cpp
+++ b/fpdfsdk/src/fsdk_mgr.cpp
@@ -10,7 +10,6 @@
#include "../include/fsdk_mgr.h"
#include "../include/formfiller/FFL_FormFiller.h"
#include "../include/javascript/IJavaScript.h"
-#include "../include/javascript/JS_Runtime.h"
#if _FX_OS_ == _FX_ANDROID_
#include "time.h"
@@ -374,7 +373,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 98ac88a9b1..748aad3a15 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 9340000118..6c403e383b 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"
@@ -403,4 +403,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 27015268ce..7026530d72 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 fc7d974395..b67096d9bc 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 0f93b0b38e..5e98b4f0ea 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 } \
@@ -481,4 +482,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 7f2c9ecf55..cf51f9f73d 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 98a963d87b..606fe4b409 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"
@@ -104,4 +104,4 @@ class CJS_GlobalData {
CFX_WideString m_sFilePath;
};
-#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 fe197c5517..2daa62608b 100644
--- a/fpdfsdk/src/javascript/JS_Runtime.cpp
+++ b/fpdfsdk/src/javascript/JS_Runtime.cpp
@@ -4,29 +4,35 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+#include "JS_Runtime.h"
+
+#include "../../include/fsdk_mgr.h" // For CPDFDoc_Environment.
#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 "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 ------------------------------ */
+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 6fdc4b0708..ac8c532b53 100644
--- a/fpdfsdk/include/javascript/JS_Runtime.h
+++ b/fpdfsdk/src/javascript/JS_Runtime.h
@@ -4,15 +4,15 @@
// 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 "../../../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;
@@ -69,4 +69,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 5b923ca4fc..974049838f 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 bac87ea657..a2e1af4dca 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 5182ae6701..bcd40422aa 100644
--- a/fpdfsdk/src/javascript/global.cpp
+++ b/fpdfsdk/src/javascript/global.cpp
@@ -4,16 +4,17 @@
// 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/javascript/resource.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 1c660397d1..394933a9ff 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"
@@ -49,7 +48,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) {