Merge to XFA: Fix (nearly all) IWYU in fpdfskd/include/javascript/ headers.
authorTom Sepez <tsepez@chromium.org>
Tue, 7 Apr 2015 22:35:48 +0000 (15:35 -0700)
committerTom Sepez <tsepez@chromium.org>
Tue, 7 Apr 2015 22:35:48 +0000 (15:35 -0700)
Original Review URL: https://codereview.chromium.org/1060133002
TBR=thestig@chromium.org

Review URL: https://codereview.chromium.org/1065103002

23 files changed:
BUILD.gn
fpdfsdk/include/javascript/Consts.h
fpdfsdk/include/javascript/Document.h
fpdfsdk/include/javascript/Field.h
fpdfsdk/include/javascript/Icon.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_Module.h [deleted file]
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/app.h
fpdfsdk/include/javascript/color.h
fpdfsdk/include/javascript/console.h
fpdfsdk/include/javascript/event.h
fpdfsdk/include/javascript/global.h
fpdfsdk/include/javascript/report.h
fpdfsdk/include/javascript/util.h
fpdfsdk/include/jsapi/fxjs_v8.h
pdfium.gyp

index 918df0f..3bbd94c 100644 (file)
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -776,7 +776,6 @@ static_library("javascript") {
     "fpdfsdk/include/javascript/JS_Define.h",
     "fpdfsdk/include/javascript/JS_EventHandler.h",
     "fpdfsdk/include/javascript/JS_GlobalData.h",
-    "fpdfsdk/include/javascript/JS_Module.h",
     "fpdfsdk/include/javascript/JS_Object.h",
     "fpdfsdk/include/javascript/JS_Runtime.h",
     "fpdfsdk/include/javascript/JS_Value.h",
index c3a954e..5d19064 100644 (file)
@@ -7,6 +7,8 @@
 #ifndef _CONSTS_H_
 #define _CONSTS_H_
 
+#include "JS_Define.h"
+
 /* ------------------------------ border ------------------------------ */
 
 class CJS_Border : public CJS_Object
index 8aa53fe..0824185 100644 (file)
@@ -7,7 +7,7 @@
 #ifndef _DOCUMENT_H_
 #define _DOCUMENT_H_
 
-
+#include "JS_Define.h"
 
 class PrintParamsObj : public CJS_EmbedObj
 {
index ba834b9..f9e5e49 100644 (file)
@@ -7,6 +7,11 @@
 #ifndef _FIELD_H_
 #define _FIELD_H_
 
+#include <string>  // For std::wstring.
+
+// TODO(tsepez): include PWL_Wnd.h for PWL_Color after fixing its IWYU.
+#include "JS_Define.h"
+
 class Document;
 
 enum FIELD_PROP
index e07ae8e..097917a 100644 (file)
@@ -7,20 +7,19 @@
 #ifndef _ICON_H_
 #define _ICON_H_
 
+#include "JS_Define.h"
+
 class Icon : public CJS_EmbedObj
 {
 public:
        Icon(CJS_Object* pJSObject);
        virtual ~Icon();
-
-public:
        FX_BOOL name(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
-       
-public:
        void                            SetStream(CPDF_Stream* pIconStream);
        CPDF_Stream*            GetStream();
        void                            SetIconName(CFX_WideString name);
        CFX_WideString          GetIconName();
+
 private:
        CPDF_Stream*            m_pIconStream;
        CFX_WideString          m_swIconName;
index adb28cd..b35ba3b 100644 (file)
@@ -7,6 +7,10 @@
 #ifndef _JS_CONTEXT_H_
 #define _JS_CONTEXT_H_
 
+#include "../../../core/include/fxcrt/fx_system.h"
+#include "../../../core/include/fxcrt/fx_string.h"
+#include "IJavaScript.h"
+
 class CJS_EventHandler;
 class CJS_Runtime;
 
index 2213ff9..7175ece 100644 (file)
 #include "../jsapi/fxjs_v8.h"
 #include "resource.h"
 
-typedef v8::Value                      JSValue;
-typedef v8::Handle<v8::Object> JSObject;
-typedef v8::Handle<v8::Object> JSFXObject;
-
 #include "JS_Object.h"
 #include "JS_Value.h"
 
index d16933a..a6736d3 100644 (file)
@@ -7,7 +7,14 @@
 #ifndef _JS_EVENTHANDLER_H_
 #define _JS_EVENTHANDLER_H_
 
+#include "../../../core/include/fxcrt/fx_string.h"
+#include "../../../core/include/fxcrt/fx_system.h"
+
 class CJS_Context;
+class CPDFSDK_Annot;
+class CPDFSDK_Document;
+class CPDF_Bookmark;
+class CPDF_FormField;
 class Field;
 
 enum JS_EVENT_T
index c54d7b5..b21a360 100644 (file)
@@ -7,6 +7,8 @@
 #ifndef _JS_GLOBALDATA_H_
 #define _JS_GLOBALDATA_H_
 
+#include "../../../core/include/fxcrt/fx_basic.h"
+
 #define JS_GLOBALDATA_TYPE_NUMBER              0
 #define JS_GLOBALDATA_TYPE_BOOLEAN             1
 #define JS_GLOBALDATA_TYPE_STRING              2
@@ -14,8 +16,7 @@
 #define JS_GLOBALDATA_TYPE_NULL                        4
 
 class CJS_KeyValue;
-class CJS_GlobalVariableArray;
-class CJS_GlobalData_Element;
+class CPDFDoc_Environment;
 
 class CJS_GlobalVariableArray
 {
diff --git a/fpdfsdk/include/javascript/JS_Module.h b/fpdfsdk/include/javascript/JS_Module.h
deleted file mode 100644 (file)
index 1fcb583..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-// Copyright 2014 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 _JS_MODULE_H_
-#define _JS_MODULE_H_
-
-class CJS_GlobalData;
-class CJS_ConsoleDlg;
-
-class CJS_Module : public IReader_Module
-{
-public:
-       CJS_Module(HMODULE hModule, CReader_App* pApp);
-       virtual ~CJS_Module();
-
-       virtual void                                    Destroy(){delete this;}
-       virtual CFX_ByteString                  GetModuleName();
-
-public:
-       static CJS_Module*                              GetModule(CReader_App* pApp);
-
-       IFXJS_Runtime*                                  NewJSRuntime();
-       CJS_GlobalData*                                 NewGlobalData();
-       void                                                    ReleaseGlobalData();
-
-public:
-       //console
-       void                                                    ShowConsole();
-       void                                                    HideConsole();
-       void                                                    ClearConsole();
-       void                                                    PrintLineConsole(FX_LPCWSTR string);
-
-private:
-       HMODULE                                                 m_hModule;
-       CReader_App*                                    m_pApp;
-
-       FX_BOOL                                                 m_bInitial;
-       CJS_GlobalData*                                 m_pGlobalData;
-       FX_INT32                                                m_nGlobalDataCount;
-
-       CJS_ConsoleDlg*                                 m_pConsole;
-};
-
-#endif //_JS_MODULE_H_
\ No newline at end of file
index f30bc17..74af9ba 100644 (file)
@@ -10,6 +10,7 @@
 #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"
 
 class CPDFSDK_PageView;
 class CJS_Object;
index 96f00bb..86d4971 100644 (file)
@@ -7,6 +7,13 @@
 #ifndef _JS_RUNTIME_H_
 #define _JS_RUNTIME_H_
 
+#include "../../../core/include/fxcrt/fx_basic.h"
+#include "../jsapi/fxjs_v8.h"
+#include "IJavaScript.h"
+#include "JS_EventHandler.h"
+
+class CJS_Context;
+
 class CJS_FieldEvent
 {
 public:
index 165898c..1431349 100644 (file)
@@ -7,6 +7,9 @@
 #ifndef _JS_VALUE_H_
 #define _JS_VALUE_H_
 
+#include "../jsapi/fxjs_v8.h"
+#include "../../../core/include/fxcrt/fx_basic.h"
+
 class CJS_Array;
 class CJS_Date;
 class CJS_Document;
index 1decb6f..e7a4010 100644 (file)
@@ -7,6 +7,8 @@
 #ifndef _PUBLICMETHODS_H_
 #define _PUBLICMETHODS_H_
 
+#include "JS_Define.h"
+
 class CJS_PublicMethods : public CJS_Object
 {
 public:
index 3acbb81..a515df4 100644 (file)
@@ -7,6 +7,8 @@
 #ifndef _APP_H_
 #define _APP_H_
 
+#include "JS_Define.h"
+
 class CJS_Runtime;
 
 /* ---------------------------- TimerObj ---------------------------- */
index d042a67..6eeb37b 100644 (file)
@@ -7,6 +7,9 @@
 #ifndef _COLOR_H_
 #define _COLOR_H_
 
+#include "JS_Define.h"
+// TODO(tsepez): include CPWL_Color.h once its own IWYU is fixed.
+
 class color : public CJS_EmbedObj
 {
 public:
index 336ba08..60326aa 100644 (file)
@@ -7,6 +7,8 @@
 #ifndef _CONSOLE_H_
 #define _CONSOLE_H_
 
+#include "JS_Define.h"
+
 class console : public CJS_EmbedObj
 {
 public:
index 94b4124..b3418c2 100644 (file)
@@ -7,6 +7,8 @@
 #ifndef _EVENT_H_
 #define _EVENT_H_
 
+#include "JS_Define.h"
+
 class event : public CJS_EmbedObj
 {
 public:
index b7e6e51..9ee9f42 100644 (file)
@@ -7,7 +7,11 @@
 #ifndef _GLOBAL_H_
 #define _GLOBAL_H_
 
+#include "JS_Define.h"
+
 class CJS_GlobalData;
+class CJS_GlobalVariableArray;
+class CJS_KeyValue;
 
 struct js_global_data
 {
index 822250e..05e7ddd 100644 (file)
@@ -7,6 +7,8 @@
 #ifndef _REPORT_H_
 #define _REPORT_H_
 
+#include "JS_Define.h"
+
 class Report : public CJS_EmbedObj
 {
 public:
index 72473d0..7601f7a 100644 (file)
@@ -7,6 +7,10 @@
 #ifndef _UTIL_H_
 #define _UTIL_H_
 
+#include <string>  // For std::wstring.
+
+#include "JS_Define.h"
+
 class util : public CJS_EmbedObj
 {
 public:
index 70653c5..739fd2d 100644 (file)
@@ -4,12 +4,19 @@
 
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
+// PDFium wrapper around V8 APIs. PDFium code should include this file rather
+// than including V8 headers directly.
+
 #ifndef FXJSAPI_H
 #define FXJSAPI_H
 
 #include <v8.h>
 #include "../../../core/include/fxcrt/fx_string.h"  // For CFX_WideString
 
+typedef v8::Value                      JSValue;
+typedef v8::Handle<v8::Object> JSObject;
+typedef v8::Handle<v8::Object> JSFXObject;
+
 enum FXJSOBJTYPE
 {
        JS_DYNAMIC = 0,
index 23bae8d..56d33b5 100644 (file)
         'fpdfsdk/include/javascript/JS_Define.h',
         'fpdfsdk/include/javascript/JS_EventHandler.h',
         'fpdfsdk/include/javascript/JS_GlobalData.h',
-        'fpdfsdk/include/javascript/JS_Module.h',
         'fpdfsdk/include/javascript/JS_Object.h',
         'fpdfsdk/include/javascript/JS_Runtime.h',
         'fpdfsdk/include/javascript/JS_Value.h',