102 lines
2.9 KiB
Diff
102 lines
2.9 KiB
Diff
diff --git a/build/linux/unbundle/libxml.gn b/build/linux/unbundle/libxml.gn
|
|
index c481bd3..3aaa1a4 100644
|
|
--- a/build/linux/unbundle/libxml.gn
|
|
+++ b/build/linux/unbundle/libxml.gn
|
|
@@ -8,11 +8,52 @@ pkg_config("system_libxml") {
|
|
packages = [ "libxml-2.0" ]
|
|
}
|
|
|
|
-static_library("libxml") {
|
|
+source_set("libxml") {
|
|
+ public_configs = [ ":system_libxml" ]
|
|
+}
|
|
+
|
|
+static_library("libxml_utils") {
|
|
+ # Do not expand this visibility list without first consulting with the
|
|
+ # Security Team.
|
|
+ visibility = [
|
|
+ ":xml_reader",
|
|
+ ":xml_writer",
|
|
+ "//base/test:test_support",
|
|
+ "//services/data_decoder:xml_parser_fuzzer",
|
|
+ ]
|
|
sources = [
|
|
"chromium/libxml_utils.cc",
|
|
"chromium/libxml_utils.h",
|
|
]
|
|
-
|
|
public_configs = [ ":system_libxml" ]
|
|
}
|
|
+
|
|
+static_library("xml_reader") {
|
|
+ # Do not expand this visibility list without first consulting with the
|
|
+ # Security Team.
|
|
+ visibility = [
|
|
+ "//base/test:test_support",
|
|
+ "//components/policy/core/common:unit_tests",
|
|
+ "//services/data_decoder:*",
|
|
+ "//tools/traffic_annotation/auditor:auditor_sources",
|
|
+ ]
|
|
+ sources = [
|
|
+ "chromium/xml_reader.cc",
|
|
+ "chromium/xml_reader.h",
|
|
+ ]
|
|
+ deps = [
|
|
+ ":libxml_utils",
|
|
+ ]
|
|
+}
|
|
+
|
|
+static_library("xml_writer") {
|
|
+ # The XmlWriter is considered safe to use from any target.
|
|
+ visibility = [ "*" ]
|
|
+ sources = [
|
|
+ "chromium/xml_writer.cc",
|
|
+ "chromium/xml_writer.h",
|
|
+ ]
|
|
+ deps = [
|
|
+ ":libxml_utils",
|
|
+ ]
|
|
+}
|
|
diff --git a/third_party/libxml/chromium/libxml_utils.h b/third_party/libxml/chromium/libxml_utils.h
|
|
index ff969fa..e0f3ecd 100644
|
|
--- a/third_party/libxml/chromium/libxml_utils.h
|
|
+++ b/third_party/libxml/chromium/libxml_utils.h
|
|
@@ -6,8 +6,7 @@
|
|
#define THIRD_PARTY_LIBXML_CHROMIUM_LIBXML_UTILS_H_
|
|
|
|
#include <string>
|
|
-
|
|
-#include "third_party/libxml/src/include/libxml/xmlreader.h"
|
|
+#include <libxml/xmlreader.h>
|
|
|
|
// libxml uses a global error function pointer for reporting errors.
|
|
// A ScopedXmlErrorFunc object lets you change the global error pointer
|
|
diff --git a/third_party/libxml/chromium/xml_reader.cc b/third_party/libxml/chromium/xml_reader.cc
|
|
index 92464f4..4779290 100644
|
|
--- a/third_party/libxml/chromium/xml_reader.cc
|
|
+++ b/third_party/libxml/chromium/xml_reader.cc
|
|
@@ -7,7 +7,8 @@
|
|
#include <vector>
|
|
|
|
#include "third_party/libxml/chromium/libxml_utils.h"
|
|
-#include "third_party/libxml/src/include/libxml/xmlreader.h"
|
|
+
|
|
+#include <libxml/xmlreader.h>
|
|
|
|
using internal::XmlStringToStdString;
|
|
|
|
diff --git a/third_party/libxml/chromium/xml_writer.cc b/third_party/libxml/chromium/xml_writer.cc
|
|
index 51fce8e..aa3a34f 100644
|
|
--- a/third_party/libxml/chromium/xml_writer.cc
|
|
+++ b/third_party/libxml/chromium/xml_writer.cc
|
|
@@ -5,7 +5,8 @@
|
|
#include "third_party/libxml/chromium/xml_writer.h"
|
|
|
|
#include "third_party/libxml/chromium/libxml_utils.h"
|
|
-#include "third_party/libxml/src/include/libxml/xmlwriter.h"
|
|
+
|
|
+#include <libxml/xmlwriter.h>
|
|
|
|
XmlWriter::XmlWriter() : writer_(nullptr), buffer_(nullptr) {}
|
|
|