Do more IWYU in fxjs/.

Change-Id: I778085c6e21904e697d5899a93f4e4e9fca92478
Reviewed-on: https://pdfium-review.googlesource.com/c/44272
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/fxjs/cjs_annot.cpp b/fxjs/cjs_annot.cpp
index dda52f6..7b0dee6 100644
--- a/fxjs/cjs_annot.cpp
+++ b/fxjs/cjs_annot.cpp
@@ -6,6 +6,7 @@
 
 #include "fxjs/cjs_annot.h"
 
+#include "fpdfsdk/cpdfsdk_baannot.h"
 #include "fxjs/cjs_event_context.h"
 #include "fxjs/cjs_object.h"
 #include "fxjs/js_define.h"
@@ -37,6 +38,10 @@
 
 CJS_Annot::~CJS_Annot() = default;
 
+void CJS_Annot::SetSDKAnnot(CPDFSDK_BAAnnot* annot) {
+  m_pAnnot.Reset(annot);
+}
+
 CJS_Result CJS_Annot::get_hidden(CJS_Runtime* pRuntime) {
   if (!m_pAnnot)
     return CJS_Result::Failure(JSMessage::kBadObjectError);
diff --git a/fxjs/cjs_annot.h b/fxjs/cjs_annot.h
index ea2168e..0c2a66b 100644
--- a/fxjs/cjs_annot.h
+++ b/fxjs/cjs_annot.h
@@ -7,9 +7,11 @@
 #ifndef FXJS_CJS_ANNOT_H_
 #define FXJS_CJS_ANNOT_H_
 
-#include "fpdfsdk/cpdfsdk_baannot.h"
+#include "fxjs/cjs_object.h"
 #include "fxjs/js_define.h"
 
+class CPDFSDK_BAAnnot;
+
 class CJS_Annot final : public CJS_Object {
  public:
   static int GetObjDefnID();
@@ -18,7 +20,7 @@
   CJS_Annot(v8::Local<v8::Object> pObject, CJS_Runtime* pRuntime);
   ~CJS_Annot() override;
 
-  void SetSDKAnnot(CPDFSDK_BAAnnot* annot) { m_pAnnot.Reset(annot); }
+  void SetSDKAnnot(CPDFSDK_BAAnnot* annot);
 
   JS_STATIC_PROP(hidden, hidden, CJS_Annot);
   JS_STATIC_PROP(name, name, CJS_Annot);
diff --git a/fxjs/cjs_app.h b/fxjs/cjs_app.h
index 5f211d7..9948133 100644
--- a/fxjs/cjs_app.h
+++ b/fxjs/cjs_app.h
@@ -11,6 +11,7 @@
 #include <set>
 #include <vector>
 
+#include "fxjs/cjs_object.h"
 #include "fxjs/js_define.h"
 
 class CJS_Runtime;
diff --git a/fxjs/cjs_border.h b/fxjs/cjs_border.h
index 8122934..ceb9b03 100644
--- a/fxjs/cjs_border.h
+++ b/fxjs/cjs_border.h
@@ -7,7 +7,7 @@
 #ifndef FXJS_CJS_BORDER_H_
 #define FXJS_CJS_BORDER_H_
 
-#include "fxjs/js_define.h"
+#include "fxjs/cjs_object.h"
 
 class CJS_Border final : public CJS_Object {
  public:
diff --git a/fxjs/cjs_color.h b/fxjs/cjs_color.h
index 4e28166..cb9384d 100644
--- a/fxjs/cjs_color.h
+++ b/fxjs/cjs_color.h
@@ -9,6 +9,7 @@
 
 #include <vector>
 
+#include "fxjs/cjs_object.h"
 #include "fxjs/js_define.h"
 
 class CJS_Color final : public CJS_Object {
diff --git a/fxjs/cjs_console.h b/fxjs/cjs_console.h
index 59276be..bdf8d51 100644
--- a/fxjs/cjs_console.h
+++ b/fxjs/cjs_console.h
@@ -9,6 +9,7 @@
 
 #include <vector>
 
+#include "fxjs/cjs_object.h"
 #include "fxjs/js_define.h"
 
 class CJS_Console final : public CJS_Object {
diff --git a/fxjs/cjs_display.h b/fxjs/cjs_display.h
index 35eebba..eaa700e 100644
--- a/fxjs/cjs_display.h
+++ b/fxjs/cjs_display.h
@@ -7,7 +7,7 @@
 #ifndef FXJS_CJS_DISPLAY_H_
 #define FXJS_CJS_DISPLAY_H_
 
-#include "fxjs/js_define.h"
+#include "fxjs/cjs_object.h"
 
 class CJS_Display final : public CJS_Object {
  public:
diff --git a/fxjs/cjs_document.h b/fxjs/cjs_document.h
index ed8bcc0..7072dfe 100644
--- a/fxjs/cjs_document.h
+++ b/fxjs/cjs_document.h
@@ -12,6 +12,7 @@
 #include <vector>
 
 #include "core/fxcrt/observable.h"
+#include "fxjs/cjs_object.h"
 #include "fxjs/js_define.h"
 
 class CPDFSDK_InteractiveForm;
diff --git a/fxjs/cjs_event.h b/fxjs/cjs_event.h
index a6308ec..4b55788 100644
--- a/fxjs/cjs_event.h
+++ b/fxjs/cjs_event.h
@@ -7,6 +7,7 @@
 #ifndef FXJS_CJS_EVENT_H_
 #define FXJS_CJS_EVENT_H_
 
+#include "fxjs/cjs_object.h"
 #include "fxjs/js_define.h"
 
 class CJS_Event final : public CJS_Object {
diff --git a/fxjs/cjs_field.h b/fxjs/cjs_field.h
index 290192a..3d11475 100644
--- a/fxjs/cjs_field.h
+++ b/fxjs/cjs_field.h
@@ -11,6 +11,7 @@
 #include <vector>
 
 #include "fxjs/cjs_document.h"
+#include "fxjs/cjs_object.h"
 #include "fxjs/js_define.h"
 
 class CPDF_FormControl;
diff --git a/fxjs/cjs_font.h b/fxjs/cjs_font.h
index 56b3db0..39de804 100644
--- a/fxjs/cjs_font.h
+++ b/fxjs/cjs_font.h
@@ -7,7 +7,7 @@
 #ifndef FXJS_CJS_FONT_H_
 #define FXJS_CJS_FONT_H_
 
-#include "fxjs/js_define.h"
+#include "fxjs/cjs_object.h"
 
 class CJS_Font final : public CJS_Object {
  public:
diff --git a/fxjs/cjs_global.h b/fxjs/cjs_global.h
index 454ddf9..abdcfa3 100644
--- a/fxjs/cjs_global.h
+++ b/fxjs/cjs_global.h
@@ -12,7 +12,8 @@
 #include <vector>
 
 #include "fxjs/cjs_keyvalue.h"
-#include "fxjs/js_define.h"
+#include "fxjs/cjs_object.h"
+#include "fxjs/cjs_result.h"
 
 class CJS_GlobalData;
 
diff --git a/fxjs/cjs_globalarrays.h b/fxjs/cjs_globalarrays.h
index cfd90af..244db2e 100644
--- a/fxjs/cjs_globalarrays.h
+++ b/fxjs/cjs_globalarrays.h
@@ -7,7 +7,7 @@
 #ifndef FXJS_CJS_GLOBALARRAYS_H_
 #define FXJS_CJS_GLOBALARRAYS_H_
 
-#include "fxjs/js_define.h"
+#include "fxjs/cjs_object.h"
 
 class CJS_GlobalArrays final : public CJS_Object {
  public:
diff --git a/fxjs/cjs_globalconsts.h b/fxjs/cjs_globalconsts.h
index 1846c41..71c689b 100644
--- a/fxjs/cjs_globalconsts.h
+++ b/fxjs/cjs_globalconsts.h
@@ -7,7 +7,7 @@
 #ifndef FXJS_CJS_GLOBALCONSTS_H_
 #define FXJS_CJS_GLOBALCONSTS_H_
 
-#include "fxjs/js_define.h"
+#include "fxjs/cjs_object.h"
 
 class CJS_GlobalConsts final : public CJS_Object {
  public:
diff --git a/fxjs/cjs_highlight.h b/fxjs/cjs_highlight.h
index acf03e8..5290c17 100644
--- a/fxjs/cjs_highlight.h
+++ b/fxjs/cjs_highlight.h
@@ -7,7 +7,7 @@
 #ifndef FXJS_CJS_HIGHLIGHT_H_
 #define FXJS_CJS_HIGHLIGHT_H_
 
-#include "fxjs/js_define.h"
+#include "fxjs/cjs_object.h"
 
 class CJS_Highlight final : public CJS_Object {
  public:
diff --git a/fxjs/cjs_icon.h b/fxjs/cjs_icon.h
index a92509d..9c2d64a 100644
--- a/fxjs/cjs_icon.h
+++ b/fxjs/cjs_icon.h
@@ -7,6 +7,7 @@
 #ifndef FXJS_CJS_ICON_H_
 #define FXJS_CJS_ICON_H_
 
+#include "fxjs/cjs_object.h"
 #include "fxjs/js_define.h"
 
 class CJS_Icon final : public CJS_Object {
diff --git a/fxjs/cjs_position.h b/fxjs/cjs_position.h
index 3db83ff..f5c386b 100644
--- a/fxjs/cjs_position.h
+++ b/fxjs/cjs_position.h
@@ -7,7 +7,7 @@
 #ifndef FXJS_CJS_POSITION_H_
 #define FXJS_CJS_POSITION_H_
 
-#include "fxjs/js_define.h"
+#include "fxjs/cjs_object.h"
 
 class CJS_Position final : public CJS_Object {
  public:
diff --git a/fxjs/cjs_printparamsobj.cpp b/fxjs/cjs_printparamsobj.cpp
index 7cb32de..37ff956 100644
--- a/fxjs/cjs_printparamsobj.cpp
+++ b/fxjs/cjs_printparamsobj.cpp
@@ -6,6 +6,8 @@
 
 #include "fxjs/cjs_printparamsobj.h"
 
+#include "fxjs/js_define.h"
+
 int CJS_PrintParamsObj::ObjDefnID = -1;
 
 // static
diff --git a/fxjs/cjs_printparamsobj.h b/fxjs/cjs_printparamsobj.h
index 69071e6..f8b0557 100644
--- a/fxjs/cjs_printparamsobj.h
+++ b/fxjs/cjs_printparamsobj.h
@@ -7,7 +7,7 @@
 #ifndef FXJS_CJS_PRINTPARAMSOBJ_H_
 #define FXJS_CJS_PRINTPARAMSOBJ_H_
 
-#include "fxjs/js_define.h"
+#include "fxjs/cjs_object.h"
 
 class CJS_PrintParamsObj final : public CJS_Object {
  public:
diff --git a/fxjs/cjs_publicmethods.h b/fxjs/cjs_publicmethods.h
index 049fa68..975ba6e 100644
--- a/fxjs/cjs_publicmethods.h
+++ b/fxjs/cjs_publicmethods.h
@@ -9,7 +9,8 @@
 
 #include <vector>
 
-#include "fxjs/js_define.h"
+#include "fxjs/cjs_object.h"
+#include "fxjs/cjs_result.h"
 
 class CJS_PublicMethods final : public CJS_Object {
  public:
diff --git a/fxjs/cjs_report.h b/fxjs/cjs_report.h
index 6606d14..919664d 100644
--- a/fxjs/cjs_report.h
+++ b/fxjs/cjs_report.h
@@ -9,6 +9,7 @@
 
 #include <vector>
 
+#include "fxjs/cjs_object.h"
 #include "fxjs/js_define.h"
 
 class CJS_Report final : public CJS_Object {
diff --git a/fxjs/cjs_scalehow.h b/fxjs/cjs_scalehow.h
index a5e4435..a5c895a 100644
--- a/fxjs/cjs_scalehow.h
+++ b/fxjs/cjs_scalehow.h
@@ -7,7 +7,7 @@
 #ifndef FXJS_CJS_SCALEHOW_H_
 #define FXJS_CJS_SCALEHOW_H_
 
-#include "fxjs/js_define.h"
+#include "fxjs/cjs_object.h"
 
 class CJS_ScaleHow final : public CJS_Object {
  public:
diff --git a/fxjs/cjs_scalewhen.h b/fxjs/cjs_scalewhen.h
index c0117ee..77980dc 100644
--- a/fxjs/cjs_scalewhen.h
+++ b/fxjs/cjs_scalewhen.h
@@ -7,7 +7,7 @@
 #ifndef FXJS_CJS_SCALEWHEN_H_
 #define FXJS_CJS_SCALEWHEN_H_
 
-#include "fxjs/js_define.h"
+#include "fxjs/cjs_object.h"
 
 class CJS_ScaleWhen final : public CJS_Object {
  public:
diff --git a/fxjs/cjs_style.h b/fxjs/cjs_style.h
index 8ddd6a3..6d11170 100644
--- a/fxjs/cjs_style.h
+++ b/fxjs/cjs_style.h
@@ -7,7 +7,7 @@
 #ifndef FXJS_CJS_STYLE_H_
 #define FXJS_CJS_STYLE_H_
 
-#include "fxjs/js_define.h"
+#include "fxjs/cjs_object.h"
 
 class CJS_Style final : public CJS_Object {
  public:
diff --git a/fxjs/cjs_timerobj.h b/fxjs/cjs_timerobj.h
index 5892849..69effa6 100644
--- a/fxjs/cjs_timerobj.h
+++ b/fxjs/cjs_timerobj.h
@@ -7,7 +7,7 @@
 #ifndef FXJS_CJS_TIMEROBJ_H_
 #define FXJS_CJS_TIMEROBJ_H_
 
-#include "fxjs/js_define.h"
+#include "fxjs/cjs_object.h"
 
 class GlobalTimer;
 
diff --git a/fxjs/cjs_util.h b/fxjs/cjs_util.h
index 934a0f8..917d797 100644
--- a/fxjs/cjs_util.h
+++ b/fxjs/cjs_util.h
@@ -10,6 +10,7 @@
 #include <string>
 #include <vector>
 
+#include "fxjs/cjs_object.h"
 #include "fxjs/js_define.h"
 
 // Return values for ParseDataType() below.
diff --git a/fxjs/cjs_zoomtype.h b/fxjs/cjs_zoomtype.h
index 892f72e..dc9897a 100644
--- a/fxjs/cjs_zoomtype.h
+++ b/fxjs/cjs_zoomtype.h
@@ -7,7 +7,7 @@
 #ifndef FXJS_CJS_ZOOMTYPE_H_
 #define FXJS_CJS_ZOOMTYPE_H_
 
-#include "fxjs/js_define.h"
+#include "fxjs/cjs_object.h"
 
 class CJS_Zoomtype final : public CJS_Object {
  public:
diff --git a/fxjs/js_define.h b/fxjs/js_define.h
index 9187e60..bf7aa35 100644
--- a/fxjs/js_define.h
+++ b/fxjs/js_define.h
@@ -11,11 +11,13 @@
 
 #include "core/fxcrt/unowned_ptr.h"
 #include "fxjs/cfxjs_engine.h"
-#include "fxjs/cjs_object.h"
 #include "fxjs/cjs_result.h"
+#include "fxjs/cjs_runtime.h"
 #include "fxjs/js_resources.h"
 #include "third_party/base/ptr_util.h"
 
+class CJS_Object;
+
 double JS_GetDateTime();
 int JS_GetYearFromTime(double dt);
 int JS_GetMonthFromTime(double dt);
diff --git a/testing/xfa_js_embedder_test.h b/testing/xfa_js_embedder_test.h
index 0c8b08e..7200658 100644
--- a/testing/xfa_js_embedder_test.h
+++ b/testing/xfa_js_embedder_test.h
@@ -11,7 +11,6 @@
 #include "testing/embedder_test.h"
 #include "xfa/fxfa/parser/cxfa_document.h"
 #include "xfa/fxfa/parser/cxfa_node.h"
-#include "xfa/fxfa/parser/cxfa_object.h"
 
 class CFXJSE_Engine;
 class CFXJSE_Value;