Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(352)

Unified Diff: third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.cpp

Issue 2788063002: Disable various unused libxml features: catalogs, DocBook, legacy APIs, etc. (Closed)
Patch Set: Remove files from build, remove regexp fuzzer. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « testing/libfuzzer/fuzzers/libxml_xml_regexp_compile_fuzzer.cc ('k') | third_party/libxml/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.cpp
diff --git a/third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.cpp b/third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.cpp
index 6638937487d0876d9b3b02c00116bc66b1ee335c..f14e8c3185c3555bc5e78d53cc4b3ffc76274f26 100644
--- a/third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.cpp
+++ b/third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.cpp
@@ -26,7 +26,6 @@
#include "core/xml/parser/XMLDocumentParser.h"
-#include <libxml/catalog.h>
#include <libxml/parser.h>
#include <libxml/parserInternals.h>
#include <libxslt/xslt.h>
@@ -572,12 +571,13 @@ static void finishParsing(xmlParserCtxtPtr ctxt) {
#error "Use parseChunk instead to select the correct encoding."
static bool isLibxmlDefaultCatalogFile(const String& urlString) {
- // On non-Windows platforms libxml asks for this URL, the
- // "XML_XML_DEFAULT_CATALOG", on initialization.
+ // On non-Windows platforms libxml with catalogs enabled asks for
+ // this URL, the "XML_XML_DEFAULT_CATALOG", on initialization.
if (urlString == "file:///etc/xml/catalog")
return true;
- // On Windows, libxml computes a URL relative to where its DLL resides.
+ // On Windows, libxml with catalogs enabled computes a URL relative
+ // to where its DLL resides.
if (urlString.startsWith("file:///", TextCaseASCIIInsensitive) &&
urlString.endsWith("/etc/catalog", TextCaseASCIIInsensitive))
return true;
@@ -587,10 +587,9 @@ static bool isLibxmlDefaultCatalogFile(const String& urlString) {
static bool shouldAllowExternalLoad(const KURL& url) {
String urlString = url.getString();
- // This isn't really necessary now that initializeLibXMLIfNecessary
- // disables catalog support in libxml, but keeping it for defense in depth.
- if (isLibxmlDefaultCatalogFile(url))
- return false;
+ // libxml should not be configured with catalogs enabled, so it
+ // should not be asking to load default catalogs.
+ CHECK(!isLibxmlDefaultCatalogFile(url));
// The most common DTD. There isn't much point in hammering www.w3c.org by
// requesting this URL for every XHTML document.
@@ -697,10 +696,6 @@ static void initializeLibXMLIfNecessary() {
if (didInit)
return;
- // We don't want libxml to try and load catalogs.
- // FIXME: It's not nice to set global settings in libxml, embedders of Blink
- // could be trying to use libxml themselves.
- xmlCatalogSetDefaults(XML_CATA_ALLOW_NONE);
xmlInitParser();
xmlRegisterInputCallbacks(matchFunc, openFunc, readFunc, closeFunc);
xmlRegisterOutputCallbacks(matchFunc, openFunc, writeFunc, closeFunc);
« no previous file with comments | « testing/libfuzzer/fuzzers/libxml_xml_regexp_compile_fuzzer.cc ('k') | third_party/libxml/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698