summaryrefslogtreecommitdiff
path: root/fpdfsdk/javascript
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-10-30 16:49:42 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-10-30 16:49:42 +0000
commit409726af056ddeab7f6fe4cf2a844bc954e77e0f (patch)
tree63b78d34387264c4411a4decd0a67f2f7bcb7e7b /fpdfsdk/javascript
parent0ead5426591630db17a4dbed34e43dfab84379d1 (diff)
downloadpdfium-409726af056ddeab7f6fe4cf2a844bc954e77e0f.tar.xz
Move JS_Object to cjs_object
This CL moves JS_Object.{cpp|h} to cjs_object.{cpp|h} and splits the cjs_embedobj out to its own files. Change-Id: I8eced9c613455638f4adeefd60e67f38c0c3c1a6 Reviewed-on: https://pdfium-review.googlesource.com/17036 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fpdfsdk/javascript')
-rw-r--r--fpdfsdk/javascript/JS_Define.h2
-rw-r--r--fpdfsdk/javascript/JS_Value.cpp2
-rw-r--r--fpdfsdk/javascript/PublicMethods.cpp2
-rw-r--r--fpdfsdk/javascript/app.cpp2
-rw-r--r--fpdfsdk/javascript/cjs_annot.cpp2
-rw-r--r--fpdfsdk/javascript/cjs_embedobj.cpp13
-rw-r--r--fpdfsdk/javascript/cjs_embedobj.h25
-rw-r--r--fpdfsdk/javascript/cjs_eventhandler.cpp2
-rw-r--r--fpdfsdk/javascript/cjs_global.cpp2
-rw-r--r--fpdfsdk/javascript/cjs_object.cpp (renamed from fpdfsdk/javascript/JS_Object.cpp)9
-rw-r--r--fpdfsdk/javascript/cjs_object.h (renamed from fpdfsdk/javascript/JS_Object.h)24
-rw-r--r--fpdfsdk/javascript/cjs_runtime.cpp2
-rw-r--r--fpdfsdk/javascript/color.cpp2
-rw-r--r--fpdfsdk/javascript/console.cpp2
-rw-r--r--fpdfsdk/javascript/event.cpp2
-rw-r--r--fpdfsdk/javascript/report.cpp2
-rw-r--r--fpdfsdk/javascript/util.cpp2
17 files changed, 56 insertions, 41 deletions
diff --git a/fpdfsdk/javascript/JS_Define.h b/fpdfsdk/javascript/JS_Define.h
index e0535fa6fc..5824011665 100644
--- a/fpdfsdk/javascript/JS_Define.h
+++ b/fpdfsdk/javascript/JS_Define.h
@@ -9,8 +9,8 @@
#include <vector>
-#include "fpdfsdk/javascript/JS_Object.h"
#include "fpdfsdk/javascript/JS_Value.h"
+#include "fpdfsdk/javascript/cjs_object.h"
#include "fpdfsdk/javascript/resource.h"
#include "fxjs/fxjs_v8.h"
diff --git a/fpdfsdk/javascript/JS_Value.cpp b/fpdfsdk/javascript/JS_Value.cpp
index b8582e9b10..da09ff28ac 100644
--- a/fpdfsdk/javascript/JS_Value.cpp
+++ b/fpdfsdk/javascript/JS_Value.cpp
@@ -14,8 +14,8 @@
#include <vector>
#include "fpdfsdk/javascript/JS_Define.h"
-#include "fpdfsdk/javascript/JS_Object.h"
#include "fpdfsdk/javascript/cjs_document.h"
+#include "fpdfsdk/javascript/cjs_object.h"
namespace {
diff --git a/fpdfsdk/javascript/PublicMethods.cpp b/fpdfsdk/javascript/PublicMethods.cpp
index b4cc7bfa28..b2469ad218 100644
--- a/fpdfsdk/javascript/PublicMethods.cpp
+++ b/fpdfsdk/javascript/PublicMethods.cpp
@@ -20,11 +20,11 @@
#include "fpdfsdk/cpdfsdk_formfillenvironment.h"
#include "fpdfsdk/cpdfsdk_interform.h"
#include "fpdfsdk/javascript/JS_Define.h"
-#include "fpdfsdk/javascript/JS_Object.h"
#include "fpdfsdk/javascript/JS_Value.h"
#include "fpdfsdk/javascript/cjs_event_context.h"
#include "fpdfsdk/javascript/cjs_eventhandler.h"
#include "fpdfsdk/javascript/cjs_field.h"
+#include "fpdfsdk/javascript/cjs_object.h"
#include "fpdfsdk/javascript/cjs_runtime.h"
#include "fpdfsdk/javascript/color.h"
#include "fpdfsdk/javascript/resource.h"
diff --git a/fpdfsdk/javascript/app.cpp b/fpdfsdk/javascript/app.cpp
index 93af088b5c..8a91a1da39 100644
--- a/fpdfsdk/javascript/app.cpp
+++ b/fpdfsdk/javascript/app.cpp
@@ -13,11 +13,11 @@
#include "fpdfsdk/cpdfsdk_formfillenvironment.h"
#include "fpdfsdk/cpdfsdk_interform.h"
#include "fpdfsdk/javascript/JS_Define.h"
-#include "fpdfsdk/javascript/JS_Object.h"
#include "fpdfsdk/javascript/JS_Value.h"
#include "fpdfsdk/javascript/cjs_document.h"
#include "fpdfsdk/javascript/cjs_event_context.h"
#include "fpdfsdk/javascript/cjs_eventhandler.h"
+#include "fpdfsdk/javascript/cjs_object.h"
#include "fpdfsdk/javascript/cjs_runtime.h"
#include "fpdfsdk/javascript/resource.h"
#include "third_party/base/stl_util.h"
diff --git a/fpdfsdk/javascript/cjs_annot.cpp b/fpdfsdk/javascript/cjs_annot.cpp
index 84c8007309..fa7773fab4 100644
--- a/fpdfsdk/javascript/cjs_annot.cpp
+++ b/fpdfsdk/javascript/cjs_annot.cpp
@@ -7,9 +7,9 @@
#include "fpdfsdk/javascript/cjs_annot.h"
#include "fpdfsdk/javascript/JS_Define.h"
-#include "fpdfsdk/javascript/JS_Object.h"
#include "fpdfsdk/javascript/JS_Value.h"
#include "fpdfsdk/javascript/cjs_event_context.h"
+#include "fpdfsdk/javascript/cjs_object.h"
namespace {
diff --git a/fpdfsdk/javascript/cjs_embedobj.cpp b/fpdfsdk/javascript/cjs_embedobj.cpp
new file mode 100644
index 0000000000..fe17862e69
--- /dev/null
+++ b/fpdfsdk/javascript/cjs_embedobj.cpp
@@ -0,0 +1,13 @@
+// Copyright 2017 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#include "fpdfsdk/javascript/cjs_embedobj.h"
+
+#include "fpdfsdk/javascript/cjs_object.h"
+
+CJS_EmbedObj::CJS_EmbedObj(CJS_Object* pJSObject) : m_pJSObject(pJSObject) {}
+
+CJS_EmbedObj::~CJS_EmbedObj() {}
diff --git a/fpdfsdk/javascript/cjs_embedobj.h b/fpdfsdk/javascript/cjs_embedobj.h
new file mode 100644
index 0000000000..edc9ac5c11
--- /dev/null
+++ b/fpdfsdk/javascript/cjs_embedobj.h
@@ -0,0 +1,25 @@
+// Copyright 2017 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef FPDFSDK_JAVASCRIPT_CJS_EMBEDOBJ_H_
+#define FPDFSDK_JAVASCRIPT_CJS_EMBEDOBJ_H_
+
+#include "core/fxcrt/unowned_ptr.h"
+
+class CJS_Object;
+
+class CJS_EmbedObj {
+ public:
+ explicit CJS_EmbedObj(CJS_Object* pJSObject);
+ virtual ~CJS_EmbedObj();
+
+ CJS_Object* GetJSObject() const { return m_pJSObject.Get(); }
+
+ protected:
+ UnownedPtr<CJS_Object> const m_pJSObject;
+};
+
+#endif // FPDFSDK_JAVASCRIPT_CJS_EMBEDOBJ_H_
diff --git a/fpdfsdk/javascript/cjs_eventhandler.cpp b/fpdfsdk/javascript/cjs_eventhandler.cpp
index 9dcc029ce9..002f6b0fd8 100644
--- a/fpdfsdk/javascript/cjs_eventhandler.cpp
+++ b/fpdfsdk/javascript/cjs_eventhandler.cpp
@@ -8,11 +8,11 @@
#include "core/fpdfdoc/cpdf_formfield.h"
#include "fpdfsdk/javascript/JS_Define.h"
-#include "fpdfsdk/javascript/JS_Object.h"
#include "fpdfsdk/javascript/JS_Value.h"
#include "fpdfsdk/javascript/cjs_document.h"
#include "fpdfsdk/javascript/cjs_event_context.h"
#include "fpdfsdk/javascript/cjs_field.h"
+#include "fpdfsdk/javascript/cjs_object.h"
#include "fpdfsdk/javascript/cjs_runtime.h"
CJS_EventHandler::CJS_EventHandler(CJS_EventContext* pContext)
diff --git a/fpdfsdk/javascript/cjs_global.cpp b/fpdfsdk/javascript/cjs_global.cpp
index 658cc86f16..5ef4d09894 100644
--- a/fpdfsdk/javascript/cjs_global.cpp
+++ b/fpdfsdk/javascript/cjs_global.cpp
@@ -15,10 +15,10 @@
#include "fpdfsdk/javascript/JS_Define.h"
#include "fpdfsdk/javascript/JS_GlobalData.h"
#include "fpdfsdk/javascript/JS_KeyValue.h"
-#include "fpdfsdk/javascript/JS_Object.h"
#include "fpdfsdk/javascript/JS_Value.h"
#include "fpdfsdk/javascript/cjs_event_context.h"
#include "fpdfsdk/javascript/cjs_eventhandler.h"
+#include "fpdfsdk/javascript/cjs_object.h"
#include "fpdfsdk/javascript/resource.h"
namespace {
diff --git a/fpdfsdk/javascript/JS_Object.cpp b/fpdfsdk/javascript/cjs_object.cpp
index b6e63b540b..282dfaf83d 100644
--- a/fpdfsdk/javascript/JS_Object.cpp
+++ b/fpdfsdk/javascript/cjs_object.cpp
@@ -4,14 +4,7 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#include "fpdfsdk/javascript/JS_Object.h"
-
-#include "fpdfsdk/javascript/JS_Define.h"
-#include "fpdfsdk/javascript/cjs_event_context.h"
-
-CJS_EmbedObj::CJS_EmbedObj(CJS_Object* pJSObject) : m_pJSObject(pJSObject) {}
-
-CJS_EmbedObj::~CJS_EmbedObj() {}
+#include "fpdfsdk/javascript/cjs_object.h"
// static
void CJS_Object::DefineConsts(CFXJS_Engine* pEngine,
diff --git a/fpdfsdk/javascript/JS_Object.h b/fpdfsdk/javascript/cjs_object.h
index 20d5203397..85dd19ccce 100644
--- a/fpdfsdk/javascript/JS_Object.h
+++ b/fpdfsdk/javascript/cjs_object.h
@@ -4,20 +4,16 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef FPDFSDK_JAVASCRIPT_JS_OBJECT_H_
-#define FPDFSDK_JAVASCRIPT_JS_OBJECT_H_
+#ifndef FPDFSDK_JAVASCRIPT_CJS_OBJECT_H_
+#define FPDFSDK_JAVASCRIPT_CJS_OBJECT_H_
-#include <map>
#include <memory>
#include "fpdfsdk/fsdk_define.h"
+#include "fpdfsdk/javascript/cjs_embedobj.h"
#include "fpdfsdk/javascript/cjs_runtime.h"
#include "fxjs/fxjs_v8.h"
-class CJS_EventContext;
-class CJS_Object;
-class CPDFSDK_FormFillEnvironment;
-
struct JSConstSpec {
enum Type { Number = 0, String = 1 };
@@ -38,17 +34,6 @@ struct JSMethodSpec {
v8::FunctionCallback pMethodCall;
};
-class CJS_EmbedObj {
- public:
- explicit CJS_EmbedObj(CJS_Object* pJSObject);
- virtual ~CJS_EmbedObj();
-
- CJS_Object* GetJSObject() const { return m_pJSObject.Get(); }
-
- protected:
- UnownedPtr<CJS_Object> const m_pJSObject;
-};
-
class CJS_Object {
public:
static void DefineConsts(CFXJS_Engine* pEngine,
@@ -80,5 +65,4 @@ class CJS_Object {
v8::Isolate* m_pIsolate;
};
-
-#endif // FPDFSDK_JAVASCRIPT_JS_OBJECT_H_
+#endif // FPDFSDK_JAVASCRIPT_CJS_OBJECT_H_
diff --git a/fpdfsdk/javascript/cjs_runtime.cpp b/fpdfsdk/javascript/cjs_runtime.cpp
index 177a6f43ac..64123ce395 100644
--- a/fpdfsdk/javascript/cjs_runtime.cpp
+++ b/fpdfsdk/javascript/cjs_runtime.cpp
@@ -11,7 +11,6 @@
#include "fpdfsdk/cpdfsdk_formfillenvironment.h"
#include "fpdfsdk/javascript/JS_Define.h"
#include "fpdfsdk/javascript/JS_GlobalData.h"
-#include "fpdfsdk/javascript/JS_Object.h"
#include "fpdfsdk/javascript/JS_Value.h"
#include "fpdfsdk/javascript/PublicMethods.h"
#include "fpdfsdk/javascript/app.h"
@@ -28,6 +27,7 @@
#include "fpdfsdk/javascript/cjs_globalconsts.h"
#include "fpdfsdk/javascript/cjs_highlight.h"
#include "fpdfsdk/javascript/cjs_icon.h"
+#include "fpdfsdk/javascript/cjs_object.h"
#include "fpdfsdk/javascript/cjs_position.h"
#include "fpdfsdk/javascript/cjs_printparamsobj.h"
#include "fpdfsdk/javascript/cjs_scalehow.h"
diff --git a/fpdfsdk/javascript/color.cpp b/fpdfsdk/javascript/color.cpp
index cb6503a06a..405f12d0f3 100644
--- a/fpdfsdk/javascript/color.cpp
+++ b/fpdfsdk/javascript/color.cpp
@@ -9,10 +9,10 @@
#include <vector>
#include "fpdfsdk/javascript/JS_Define.h"
-#include "fpdfsdk/javascript/JS_Object.h"
#include "fpdfsdk/javascript/JS_Value.h"
#include "fpdfsdk/javascript/cjs_event_context.h"
#include "fpdfsdk/javascript/cjs_eventhandler.h"
+#include "fpdfsdk/javascript/cjs_object.h"
#include "fpdfsdk/javascript/cjs_runtime.h"
const JSPropertySpec CJS_Color::PropertySpecs[] = {
diff --git a/fpdfsdk/javascript/console.cpp b/fpdfsdk/javascript/console.cpp
index c3cb8b7da7..81db44d2a1 100644
--- a/fpdfsdk/javascript/console.cpp
+++ b/fpdfsdk/javascript/console.cpp
@@ -9,10 +9,10 @@
#include <vector>
#include "fpdfsdk/javascript/JS_Define.h"
-#include "fpdfsdk/javascript/JS_Object.h"
#include "fpdfsdk/javascript/JS_Value.h"
#include "fpdfsdk/javascript/cjs_event_context.h"
#include "fpdfsdk/javascript/cjs_eventhandler.h"
+#include "fpdfsdk/javascript/cjs_object.h"
const JSMethodSpec CJS_Console::MethodSpecs[] = {{"clear", clear_static},
{"hide", hide_static},
diff --git a/fpdfsdk/javascript/event.cpp b/fpdfsdk/javascript/event.cpp
index cd40c204e7..7682a64033 100644
--- a/fpdfsdk/javascript/event.cpp
+++ b/fpdfsdk/javascript/event.cpp
@@ -7,11 +7,11 @@
#include "fpdfsdk/javascript/event.h"
#include "fpdfsdk/javascript/JS_Define.h"
-#include "fpdfsdk/javascript/JS_Object.h"
#include "fpdfsdk/javascript/JS_Value.h"
#include "fpdfsdk/javascript/cjs_event_context.h"
#include "fpdfsdk/javascript/cjs_eventhandler.h"
#include "fpdfsdk/javascript/cjs_field.h"
+#include "fpdfsdk/javascript/cjs_object.h"
const JSPropertySpec CJS_Event::PropertySpecs[] = {
{"change", get_change_static, set_change_static},
diff --git a/fpdfsdk/javascript/report.cpp b/fpdfsdk/javascript/report.cpp
index 3e18cb8909..676451af82 100644
--- a/fpdfsdk/javascript/report.cpp
+++ b/fpdfsdk/javascript/report.cpp
@@ -9,8 +9,8 @@
#include <vector>
#include "fpdfsdk/javascript/JS_Define.h"
-#include "fpdfsdk/javascript/JS_Object.h"
#include "fpdfsdk/javascript/JS_Value.h"
+#include "fpdfsdk/javascript/cjs_object.h"
const JSMethodSpec CJS_Report::MethodSpecs[] = {{"save", save_static},
{"writeText", writeText_static},
diff --git a/fpdfsdk/javascript/util.cpp b/fpdfsdk/javascript/util.cpp
index 4b0db62583..a8f5486c35 100644
--- a/fpdfsdk/javascript/util.cpp
+++ b/fpdfsdk/javascript/util.cpp
@@ -16,11 +16,11 @@
#include "core/fxcrt/fx_extension.h"
#include "fpdfsdk/javascript/JS_Define.h"
-#include "fpdfsdk/javascript/JS_Object.h"
#include "fpdfsdk/javascript/JS_Value.h"
#include "fpdfsdk/javascript/PublicMethods.h"
#include "fpdfsdk/javascript/cjs_event_context.h"
#include "fpdfsdk/javascript/cjs_eventhandler.h"
+#include "fpdfsdk/javascript/cjs_object.h"
#include "fpdfsdk/javascript/cjs_runtime.h"
#include "fpdfsdk/javascript/resource.h"