Remove STL includes for files without std:: symbols
-- convert some <cstddef> to <stddef.h> for compliance.
-- fix one IWYU
Change-Id: I785da3e836ad06943fe32fd074e4db4291a04e37
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/85271
Auto-Submit: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
diff --git a/core/fpdfdoc/cpdf_defaultappearance.h b/core/fpdfdoc/cpdf_defaultappearance.h
index c649338..ede49e3 100644
--- a/core/fpdfdoc/cpdf_defaultappearance.h
+++ b/core/fpdfdoc/cpdf_defaultappearance.h
@@ -7,8 +7,6 @@
#ifndef CORE_FPDFDOC_CPDF_DEFAULTAPPEARANCE_H_
#define CORE_FPDFDOC_CPDF_DEFAULTAPPEARANCE_H_
-#include <utility>
-
#include "core/fxcrt/fx_string.h"
#include "core/fxge/cfx_color.h"
#include "third_party/base/optional.h"
diff --git a/fpdfsdk/cpdfsdk_widget.cpp b/fpdfsdk/cpdfsdk_widget.cpp
index d92724e..9e10615 100644
--- a/fpdfsdk/cpdfsdk_widget.cpp
+++ b/fpdfsdk/cpdfsdk_widget.cpp
@@ -6,10 +6,6 @@
#include "fpdfsdk/cpdfsdk_widget.h"
-#include <memory>
-#include <sstream>
-#include <utility>
-
#include "constants/annotation_common.h"
#include "constants/appearance.h"
#include "core/fpdfapi/parser/cpdf_array.h"
diff --git a/fpdfsdk/fpdf_ppo_embeddertest.cpp b/fpdfsdk/fpdf_ppo_embeddertest.cpp
index 712fa2d..41e70d0 100644
--- a/fpdfsdk/fpdf_ppo_embeddertest.cpp
+++ b/fpdfsdk/fpdf_ppo_embeddertest.cpp
@@ -2,9 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include <memory>
-#include <string>
-
#include "core/fpdfapi/page/cpdf_form.h"
#include "core/fpdfapi/page/cpdf_formobject.h"
#include "fpdfsdk/cpdfsdk_helpers.h"
diff --git a/fxjs/cjs_event_context.h b/fxjs/cjs_event_context.h
index 3fc3245..b911fc2 100644
--- a/fxjs/cjs_event_context.h
+++ b/fxjs/cjs_event_context.h
@@ -7,8 +7,6 @@
#ifndef FXJS_CJS_EVENT_CONTEXT_H_
#define FXJS_CJS_EVENT_CONTEXT_H_
-#include <memory>
-
#include "core/fxcrt/fx_string.h"
#include "core/fxcrt/observed_ptr.h"
#include "core/fxcrt/unowned_ptr.h"
diff --git a/testing/fuzzers/BUILD.gn b/testing/fuzzers/BUILD.gn
index e6a7bc3..62539b3 100644
--- a/testing/fuzzers/BUILD.gn
+++ b/testing/fuzzers/BUILD.gn
@@ -463,6 +463,7 @@
deps = [
"../../:freetype_common",
"../../core/fpdfapi/font",
+ "../../core/fxcrt",
"../../third_party:pdfium_base",
]
}
diff --git a/testing/fuzzers/component_fuzzer_template.cc b/testing/fuzzers/component_fuzzer_template.cc
index 89883f5..47c1464 100644
--- a/testing/fuzzers/component_fuzzer_template.cc
+++ b/testing/fuzzers/component_fuzzer_template.cc
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include <cstddef>
-#include <cstdint>
+#include <stddef.h>
+#include <stdint.h>
#include "public/fpdfview.h"
diff --git a/testing/fuzzers/pdf_cmap_fuzzer.cc b/testing/fuzzers/pdf_cmap_fuzzer.cc
index 180a6a7..21a9b72 100644
--- a/testing/fuzzers/pdf_cmap_fuzzer.cc
+++ b/testing/fuzzers/pdf_cmap_fuzzer.cc
@@ -2,9 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include <cstdint>
+#include <stdint.h>
#include "core/fpdfapi/font/cpdf_cmap.h"
+#include "core/fxcrt/retain_ptr.h"
#include "third_party/base/span.h"
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
diff --git a/testing/fuzzers/pdf_codec_jbig2_fuzzer.cc b/testing/fuzzers/pdf_codec_jbig2_fuzzer.cc
index d63c9ee..2f75ce8 100644
--- a/testing/fuzzers/pdf_codec_jbig2_fuzzer.cc
+++ b/testing/fuzzers/pdf_codec_jbig2_fuzzer.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include <cstdint>
+#include <stdint.h>
#include "core/fxcodec/jbig2/JBig2_Context.h"
#include "core/fxcodec/jbig2/JBig2_DocumentContext.h"
diff --git a/testing/fuzzers/pdf_fm2js_fuzzer.cc b/testing/fuzzers/pdf_fm2js_fuzzer.cc
index 7a961c8..62e5ce2 100644
--- a/testing/fuzzers/pdf_fm2js_fuzzer.cc
+++ b/testing/fuzzers/pdf_fm2js_fuzzer.cc
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include <cstddef>
-#include <cstdint>
+#include <stddef.h>
+#include <stdint.h>
#include "core/fxcrt/cfx_widetextbuf.h"
#include "core/fxcrt/fx_safe_types.h"
diff --git a/testing/fuzzers/pdf_psengine_fuzzer.cc b/testing/fuzzers/pdf_psengine_fuzzer.cc
index d72088d..bf7e3a5 100644
--- a/testing/fuzzers/pdf_psengine_fuzzer.cc
+++ b/testing/fuzzers/pdf_psengine_fuzzer.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include <cstdint>
+#include <stdint.h>
#include "core/fpdfapi/page/cpdf_psengine.h"
#include "third_party/base/span.h"
diff --git a/testing/fuzzers/pdf_streamparser_fuzzer.cc b/testing/fuzzers/pdf_streamparser_fuzzer.cc
index 1d1144b..68506d8 100644
--- a/testing/fuzzers/pdf_streamparser_fuzzer.cc
+++ b/testing/fuzzers/pdf_streamparser_fuzzer.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include <cstdint>
+#include <stdint.h>
#include "core/fpdfapi/page/cpdf_streamparser.h"
#include "core/fpdfapi/parser/cpdf_object.h"
diff --git a/xfa/fwl/cfwl_message.h b/xfa/fwl/cfwl_message.h
index fd8fb1b..4e36a4a 100644
--- a/xfa/fwl/cfwl_message.h
+++ b/xfa/fwl/cfwl_message.h
@@ -7,8 +7,6 @@
#ifndef XFA_FWL_CFWL_MESSAGE_H_
#define XFA_FWL_CFWL_MESSAGE_H_
-#include <type_traits>
-
#include "core/fxcrt/mask.h"
#include "core/fxcrt/unowned_ptr.h"
#include "v8/include/cppgc/macros.h"
diff --git a/xfa/fwl/cfwl_themepart.h b/xfa/fwl/cfwl_themepart.h
index 6346a3b..a49bc8e 100644
--- a/xfa/fwl/cfwl_themepart.h
+++ b/xfa/fwl/cfwl_themepart.h
@@ -9,8 +9,6 @@
#include <stdint.h>
-#include <type_traits>
-
#include "core/fxcrt/fx_coordinates.h"
#include "core/fxcrt/mask.h"
#include "core/fxcrt/unowned_ptr.h"
diff --git a/xfa/fxfa/parser/cxfa_xmllocale_unittest.cpp b/xfa/fxfa/parser/cxfa_xmllocale_unittest.cpp
index d6cd3ea..1acd41e 100644
--- a/xfa/fxfa/parser/cxfa_xmllocale_unittest.cpp
+++ b/xfa/fxfa/parser/cxfa_xmllocale_unittest.cpp
@@ -4,8 +4,6 @@
#include "xfa/fxfa/parser/cxfa_xmllocale.h"
-#include <memory>
-
#include "testing/fxgc_unittest.h"
#include "testing/gtest/include/gtest/gtest.h"