Move fx_safe_types.h to include/ directory.
authorTom Sepez <tsepez@chromium.org>
Fri, 5 Jun 2015 01:53:39 +0000 (18:53 -0700)
committerTom Sepez <tsepez@chromium.org>
Fri, 5 Jun 2015 01:53:39 +0000 (18:53 -0700)
Small bit of OCD here, since this file is included cross-library
(i.e. from fpdfsk), it can't be in src/.  In other words, the
following should be empty:
    grep -R 'include.*core/src/' fpdfsdk

Fix some IWYU in it at the same time.

R=thestig@chromium.org

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

15 files changed:
BUILD.gn
core/include/fxcrt/fx_safe_types.h [new file with mode: 0644]
core/src/fdrm/crypto/fx_crypt.cpp
core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp
core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp
core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp
core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
core/src/fpdfdoc/doc_link.cpp
core/src/fxcodec/codec/fx_codec_jpeg.cpp
core/src/fxcodec/jbig2/JBig2_Image.cpp
core/src/fxcrt/extension.h
core/src/fxcrt/fx_safe_types.h [deleted file]
fpdfsdk/src/fpdfview.cpp
fpdfsdk/src/pdfwindow/PWL_Edit.cpp
pdfium.gyp

index bab57b9..54e9594 100644 (file)
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -515,6 +515,7 @@ static_library("fxcrt") {
     "core/include/fxcrt/fx_coordinates.h",
     "core/include/fxcrt/fx_ext.h",
     "core/include/fxcrt/fx_memory.h",
+    "core/include/fxcrt/fx_safe_types.h",
     "core/include/fxcrt/fx_stream.h",
     "core/include/fxcrt/fx_string.h",
     "core/include/fxcrt/fx_system.h",
@@ -536,7 +537,6 @@ static_library("fxcrt") {
     "core/src/fxcrt/fx_basic_util.cpp",
     "core/src/fxcrt/fx_basic_wstring.cpp",
     "core/src/fxcrt/fx_extension.cpp",
-    "core/src/fxcrt/fx_safe_types.h",
     "core/src/fxcrt/fx_ucddata.cpp",
     "core/src/fxcrt/fx_unicode.cpp",
     "core/src/fxcrt/fx_xml_composer.cpp",
diff --git a/core/include/fxcrt/fx_safe_types.h b/core/include/fxcrt/fx_safe_types.h
new file mode 100644 (file)
index 0000000..e45e6d3
--- /dev/null
@@ -0,0 +1,19 @@
+// 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.
+
+#ifndef CORE_INCLUDE_FXCRT_FX_SAFE_TYPES_H_
+#define CORE_INCLUDE_FXCRT_FX_SAFE_TYPES_H_
+
+#include <stdlib.h>  // For size_t.
+
+#include "../../../third_party/base/numerics/safe_math.h"
+#include "fx_stream.h"  // for FX_FILESIZE.
+#include "fx_system.h"
+
+typedef pdfium::base::CheckedNumeric<FX_DWORD> FX_SAFE_DWORD;
+typedef pdfium::base::CheckedNumeric<FX_INT32> FX_SAFE_INT32;
+typedef pdfium::base::CheckedNumeric<size_t> FX_SAFE_SIZE_T;
+typedef pdfium::base::CheckedNumeric<FX_FILESIZE> FX_SAFE_FILESIZE;
+
+#endif  // CORE_INCLUDE_FXCRT_FX_SAFE_TYPES_H_
index 1fbba99..e67e5d7 100644 (file)
@@ -4,9 +4,9 @@
  
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
-#include "../../../include/fxcrt/fx_basic.h"
 #include "../../../include/fdrm/fx_crypt.h"
-#include "../../../src/fxcrt/fx_safe_types.h"
+#include "../../../include/fxcrt/fx_basic.h"
+#include "../../../include/fxcrt/fx_safe_types.h"
 
 #ifdef __cplusplus
 extern "C" {
index 924c88e..d29dee7 100644 (file)
@@ -6,9 +6,9 @@
 
 #include <limits.h>
 
-#include "../../../include/fpdfapi/fpdf_page.h"
 #include "../../../include/fpdfapi/fpdf_module.h"
-#include "../../../src/fxcrt/fx_safe_types.h"
+#include "../../../include/fpdfapi/fpdf_page.h"
+#include "../../../include/fxcrt/fx_safe_types.h"
 #include "../../../third_party/base/numerics/safe_conversions_impl.h"
 #include "pageint.h"
 
index 0d4ed27..09d1d3e 100644 (file)
@@ -4,13 +4,14 @@
  
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
-#include "../../../include/fpdfapi/fpdf_parser.h"
+#include <utility>
+#include <vector>
+
 #include "../../../include/fpdfapi/fpdf_module.h"
 #include "../../../include/fpdfapi/fpdf_page.h"
-#include "../../../src/fxcrt/fx_safe_types.h"
+#include "../../../include/fpdfapi/fpdf_parser.h"
+#include "../../../include/fxcrt/fx_safe_types.h"
 #include "../fpdf_page/pageint.h"
-#include <utility>
-#include <vector>
 
 FX_BOOL IsSignatureDict(const CPDF_Dictionary* pDict)
 {
index 9a11fa8..214e431 100644 (file)
@@ -4,14 +4,15 @@
  
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
-#include "../../../include/fxge/fx_ge.h"
-#include "../../../include/fxcodec/fx_codec.h"
 #include "../../../include/fpdfapi/fpdf_module.h"
-#include "../../../include/fpdfapi/fpdf_render.h"
 #include "../../../include/fpdfapi/fpdf_pageobj.h"
-#include "../../fxcrt/fx_safe_types.h"
+#include "../../../include/fpdfapi/fpdf_render.h"
+#include "../../../include/fxcodec/fx_codec.h"
+#include "../../../include/fxcrt/fx_safe_types.h"
+#include "../../../include/fxge/fx_ge.h"
 #include "../fpdf_page/pageint.h"
 #include "render_int.h"
+
 FX_BOOL CPDF_RenderStatus::ProcessImage(CPDF_ImageObject* pImageObj, const CFX_AffineMatrix* pObj2Device)
 {
     CPDF_ImageRenderer render;
index b45d9c3..3fabdf9 100644 (file)
@@ -4,12 +4,12 @@
  
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
-#include "../../../include/fxge/fx_ge.h"
-#include "../../../include/fxcodec/fx_codec.h"
 #include "../../../include/fpdfapi/fpdf_module.h"
-#include "../../../include/fpdfapi/fpdf_render.h"
 #include "../../../include/fpdfapi/fpdf_pageobj.h"
-#include "../../../src/fxcrt/fx_safe_types.h"
+#include "../../../include/fpdfapi/fpdf_render.h"
+#include "../../../include/fxcodec/fx_codec.h"
+#include "../../../include/fxcrt/fx_safe_types.h"
+#include "../../../include/fxge/fx_ge.h"
 #include "../fpdf_page/pageint.h"
 #include "render_int.h"
 
index 9a08d15..1957960 100644 (file)
@@ -5,7 +5,7 @@
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
 #include "../../include/fpdfdoc/fpdf_doc.h"
-#include "../../src/fxcrt/fx_safe_types.h"
+#include "../../include/fxcrt/fx_safe_types.h"
 
 CPDF_LinkList::~CPDF_LinkList()
 {
index 3ef187e..b80facf 100644 (file)
@@ -5,9 +5,10 @@
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
 #include "../../../include/fxcodec/fx_codec.h"
+#include "../../../include/fxcrt/fx_safe_types.h"
 #include "../../../include/fxge/fx_dib.h"
-#include "../../../src/fxcrt/fx_safe_types.h"
 #include "codec_int.h"
+
 extern "C" {
     static void _JpegScanSOI(const FX_BYTE*& src_buf, FX_DWORD& src_size)
     {
index 8e27bca..f2cea59 100644 (file)
@@ -5,9 +5,10 @@
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
 #include <limits.h>
+
 #include "../../../include/fxcrt/fx_basic.h"
 #include "../../../include/fxcrt/fx_coordinates.h"
-#include "../../../src/fxcrt/fx_safe_types.h"
+#include "../../../include/fxcrt/fx_safe_types.h"
 #include "JBig2_Image.h"
 
 CJBig2_Image::CJBig2_Image(FX_INT32 w, FX_INT32 h)
index e678cbb..a59f81e 100644 (file)
@@ -7,7 +7,7 @@
 #ifndef CORE_SRC_FXCRT_EXTENSION_H_
 #define CORE_SRC_FXCRT_EXTENSION_H_
 
-#include "fx_safe_types.h"
+#include "../../include/fxcrt/fx_safe_types.h"
 
 class IFXCRT_FileAccess
 {
diff --git a/core/src/fxcrt/fx_safe_types.h b/core/src/fxcrt/fx_safe_types.h
deleted file mode 100644 (file)
index 35a906c..0000000
+++ /dev/null
@@ -1,17 +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.
-
-#ifndef CORE_SRC_FXCRT_FX_SAFE_TYPES_H_
-#define CORE_SRC_FXCRT_FX_SAFE_TYPES_H_
-
-#include <stdlib.h>  // For size_t.
-
-#include "../../../third_party/base/numerics/safe_math.h"
-
-typedef pdfium::base::CheckedNumeric<FX_DWORD> FX_SAFE_DWORD;
-typedef pdfium::base::CheckedNumeric<FX_INT32> FX_SAFE_INT32;
-typedef pdfium::base::CheckedNumeric<size_t> FX_SAFE_SIZE_T;
-typedef pdfium::base::CheckedNumeric<FX_FILESIZE> FX_SAFE_FILESIZE;
-
-#endif  // CORE_SRC_FXCRT_FX_SAFE_TYPES_H_
index 637ac96..ac7d0d6 100644 (file)
@@ -4,15 +4,15 @@
  
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
-#include "../include/fsdk_define.h"
-#include "../include/fsdk_mgr.h"
-#include "../include/fsdk_rendercontext.h"
-#include "../../public/fpdfview.h"
-#include "../../public/fpdf_progressive.h"
+#include "../../../core/include/fxcrt/fx_safe_types.h"
 #include "../../public/fpdf_ext.h"
-#include "../../../core/src/fxcrt/fx_safe_types.h"
+#include "../../public/fpdf_progressive.h"
+#include "../../public/fpdfview.h"
 #include "../../third_party/base/nonstd_unique_ptr.h"
 #include "../../third_party/base/numerics/safe_conversions_impl.h"
+#include "../include/fsdk_define.h"
+#include "../include/fsdk_mgr.h"
+#include "../include/fsdk_rendercontext.h"
 
 CPDF_CustomAccess::CPDF_CustomAccess(FPDF_FILEACCESS* pFileAccess)
 {
index 678da68..83f7340 100644 (file)
@@ -4,15 +4,15 @@
  
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
+#include "../../../core/include/fxcrt/fx_safe_types.h"
 #include "../../include/pdfwindow/PDFWindow.h"
-#include "../../include/pdfwindow/PWL_Wnd.h"
-#include "../../include/pdfwindow/PWL_EditCtrl.h"
+#include "../../include/pdfwindow/PWL_Caret.h"
 #include "../../include/pdfwindow/PWL_Edit.h"
+#include "../../include/pdfwindow/PWL_EditCtrl.h"
+#include "../../include/pdfwindow/PWL_FontMap.h"
 #include "../../include/pdfwindow/PWL_ScrollBar.h"
 #include "../../include/pdfwindow/PWL_Utils.h"
-#include "../../include/pdfwindow/PWL_Caret.h"
-#include "../../include/pdfwindow/PWL_FontMap.h"
-#include "../../../core/src/fxcrt/fx_safe_types.h"
+#include "../../include/pdfwindow/PWL_Wnd.h"
 
 /* ---------------------------- CPWL_Edit ------------------------------ */
 
index c8215e7..c8894aa 100644 (file)
         'core/include/fxcrt/fx_coordinates.h',
         'core/include/fxcrt/fx_ext.h',
         'core/include/fxcrt/fx_memory.h',
+        'core/include/fxcrt/fx_safe_types.h',
         'core/include/fxcrt/fx_stream.h',
         'core/include/fxcrt/fx_string.h',
         'core/include/fxcrt/fx_system.h',
         'core/include/fxcrt/fx_ucd.h',
         'core/include/fxcrt/fx_xml.h',
         'core/src/fxcrt/extension.h',
-        'core/src/fxcrt/fx_safe_types.h',
         'core/src/fxcrt/fxcrt_platforms.cpp',
         'core/src/fxcrt/fxcrt_platforms.h',
         'core/src/fxcrt/fxcrt_posix.cpp',