Move third_party/base/span.h to core/fxcrt
Fix some GN build rules to make the build work after moving.
Bug: pdfium:2127
Change-Id: Ic8cf0860dc5df8a510ecb34de1ffd10514d86c26
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/116650
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Thomas Sepez <tsepez@google.com>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/testing/fuzzers/BUILD.gn b/testing/fuzzers/BUILD.gn
index 6c915cb..6baf1ed 100644
--- a/testing/fuzzers/BUILD.gn
+++ b/testing/fuzzers/BUILD.gn
@@ -170,8 +170,8 @@
configs += [ ":fuzzer_config" ]
deps = [
"../../:pdfium_public_headers",
+ "../../core/fxcrt",
"../../fpdfsdk",
- "../../third_party:pdfium_base",
]
}
@@ -531,7 +531,7 @@
sources = [ "pdf_codec_icc_fuzzer.cc" ]
deps = [
"../../core/fxcodec",
- "../../third_party:pdfium_base",
+ "../../core/fxcrt",
"../../third_party/:lcms2",
]
}
diff --git a/testing/fuzzers/pdf_cmap_fuzzer.cc b/testing/fuzzers/pdf_cmap_fuzzer.cc
index 58dfbe6..030ffd9 100644
--- a/testing/fuzzers/pdf_cmap_fuzzer.cc
+++ b/testing/fuzzers/pdf_cmap_fuzzer.cc
@@ -6,7 +6,7 @@
#include "core/fpdfapi/font/cpdf_cmap.h"
#include "core/fxcrt/retain_ptr.h"
-#include "third_party/base/containers/span.h"
+#include "core/fxcrt/span.h"
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
if (size > 256 * 1024)
diff --git a/testing/fuzzers/pdf_codec_icc_fuzzer.cc b/testing/fuzzers/pdf_codec_icc_fuzzer.cc
index ada4bc7..1f74e6a 100644
--- a/testing/fuzzers/pdf_codec_icc_fuzzer.cc
+++ b/testing/fuzzers/pdf_codec_icc_fuzzer.cc
@@ -5,7 +5,7 @@
#include <cstdint>
#include "core/fxcodec/icc/icc_transform.h"
-#include "third_party/base/containers/span.h"
+#include "core/fxcrt/span.h"
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
std::unique_ptr<fxcodec::IccTransform> transform =
diff --git a/testing/fuzzers/pdf_hint_table_fuzzer.cc b/testing/fuzzers/pdf_hint_table_fuzzer.cc
index a90199c..f4b918c 100644
--- a/testing/fuzzers/pdf_hint_table_fuzzer.cc
+++ b/testing/fuzzers/pdf_hint_table_fuzzer.cc
@@ -11,7 +11,7 @@
#include "core/fpdfapi/parser/cpdf_linearized_header.h"
#include "core/fpdfapi/parser/cpdf_number.h"
#include "core/fxcrt/cfx_bitstream.h"
-#include "third_party/base/containers/span.h"
+#include "core/fxcrt/span.h"
int32_t GetData(const int32_t** data32, const uint8_t** data, size_t* size) {
const int32_t* ret = *data32;
diff --git a/testing/fuzzers/pdf_nametree_fuzzer.cc b/testing/fuzzers/pdf_nametree_fuzzer.cc
index 98a6441..fd3a441 100644
--- a/testing/fuzzers/pdf_nametree_fuzzer.cc
+++ b/testing/fuzzers/pdf_nametree_fuzzer.cc
@@ -11,7 +11,7 @@
#include "core/fpdfapi/parser/cpdf_dictionary.h"
#include "core/fpdfapi/parser/cpdf_object.h"
#include "core/fpdfdoc/cpdf_nametree.h"
-#include "third_party/base/containers/span.h"
+#include "core/fxcrt/span.h"
struct Params {
bool delete_backwards;
diff --git a/testing/fuzzers/pdf_psengine_fuzzer.cc b/testing/fuzzers/pdf_psengine_fuzzer.cc
index f24bdce..d1dbdee 100644
--- a/testing/fuzzers/pdf_psengine_fuzzer.cc
+++ b/testing/fuzzers/pdf_psengine_fuzzer.cc
@@ -5,7 +5,7 @@
#include <stdint.h>
#include "core/fpdfapi/page/cpdf_psengine.h"
-#include "third_party/base/containers/span.h"
+#include "core/fxcrt/span.h"
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
CPDF_PSEngine engine;
diff --git a/testing/fuzzers/pdf_streamparser_fuzzer.cc b/testing/fuzzers/pdf_streamparser_fuzzer.cc
index 6921cc9..8d89bed 100644
--- a/testing/fuzzers/pdf_streamparser_fuzzer.cc
+++ b/testing/fuzzers/pdf_streamparser_fuzzer.cc
@@ -6,7 +6,7 @@
#include "core/fpdfapi/page/cpdf_streamparser.h"
#include "core/fpdfapi/parser/cpdf_object.h"
-#include "third_party/base/containers/span.h"
+#include "core/fxcrt/span.h"
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
CPDF_StreamParser parser(pdfium::make_span(data, size));
diff --git a/testing/fuzzers/pdf_xml_fuzzer.cc b/testing/fuzzers/pdf_xml_fuzzer.cc
index e908a7e..bf24bce 100644
--- a/testing/fuzzers/pdf_xml_fuzzer.cc
+++ b/testing/fuzzers/pdf_xml_fuzzer.cc
@@ -9,10 +9,10 @@
#include "core/fxcrt/cfx_read_only_span_stream.h"
#include "core/fxcrt/fx_safe_types.h"
#include "core/fxcrt/fx_system.h"
+#include "core/fxcrt/span.h"
#include "core/fxcrt/xml/cfx_xmldocument.h"
#include "core/fxcrt/xml/cfx_xmlelement.h"
#include "core/fxcrt/xml/cfx_xmlparser.h"
-#include "third_party/base/containers/span.h"
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
FX_SAFE_SIZE_T safe_size = size;
diff --git a/testing/fuzzers/pdfium_fuzzer_helper.cc b/testing/fuzzers/pdfium_fuzzer_helper.cc
index 5b4fbc8..efa444f 100644
--- a/testing/fuzzers/pdfium_fuzzer_helper.cc
+++ b/testing/fuzzers/pdfium_fuzzer_helper.cc
@@ -16,12 +16,12 @@
#include <tuple>
#include <utility>
+#include "core/fxcrt/span.h"
#include "public/cpp/fpdf_scopers.h"
#include "public/fpdf_dataavail.h"
#include "public/fpdf_ext.h"
#include "public/fpdf_text.h"
#include "third_party/base/check_op.h"
-#include "third_party/base/containers/span.h"
#include "third_party/base/numerics/checked_math.h"
namespace {
diff --git a/testing/fuzzers/xfa_codec_fuzzer.h b/testing/fuzzers/xfa_codec_fuzzer.h
index aaa884b..f045438 100644
--- a/testing/fuzzers/xfa_codec_fuzzer.h
+++ b/testing/fuzzers/xfa_codec_fuzzer.h
@@ -13,8 +13,8 @@
#include "core/fxcrt/cfx_read_only_span_stream.h"
#include "core/fxcrt/fx_safe_types.h"
#include "core/fxcrt/retain_ptr.h"
+#include "core/fxcrt/span.h"
#include "core/fxge/dib/cfx_dibitmap.h"
-#include "third_party/base/containers/span.h"
// Support up to 64 MB. This prevents trivial OOM when MSAN is on and
// time outs.