From c9e19cf9d318efc7c736c3adfac91f9161beaa42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kai=20K=C3=B6hne?= Date: Thu, 29 Sep 2022 14:02:04 +0200 Subject: [PATCH] Move qurltlds_p.h out of src/network, and make it a .cpp file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The file was originally introduced as a header because the data was also used by Qt WebKit. This is not needed anymore. Moving it into src/3rdparty is also more in line with QUIP 4. [ChangeLog][Third-Party Code] The Public Suffix List (PSL) data file got moved from src/network/kernel/qurltlds_p.h to src/3rdparty/libpsl/psl_data.cpp. Change-Id: I3283cbbd72575032d8c7ebd333e81048d948c052 Reviewed-by: MÃ¥rten Nordheim Reviewed-by: Alexey Edelev --- .../libpsl}/PSL-LICENSE.txt | 0 .../libpsl/README.txt} | 8 ++--- .../libpsl/psl_data.cpp} | 0 src/3rdparty/libpsl/qt_attribution.json | 30 +++++++++++++++++++ src/network/CMakeLists.txt | 3 +- src/network/kernel/qt_attribution.json | 28 ----------------- src/network/kernel/qtldurl.cpp | 2 +- sync.profile | 3 +- 8 files changed, 38 insertions(+), 36 deletions(-) rename src/{network/kernel => 3rdparty/libpsl}/PSL-LICENSE.txt (100%) rename src/{network/kernel/qurltlds_p.h.INFO => 3rdparty/libpsl/README.txt} (72%) rename src/{network/kernel/qurltlds_p.h => 3rdparty/libpsl/psl_data.cpp} (100%) delete mode 100644 src/network/kernel/qt_attribution.json diff --git a/src/network/kernel/PSL-LICENSE.txt b/src/3rdparty/libpsl/PSL-LICENSE.txt similarity index 100% rename from src/network/kernel/PSL-LICENSE.txt rename to src/3rdparty/libpsl/PSL-LICENSE.txt diff --git a/src/network/kernel/qurltlds_p.h.INFO b/src/3rdparty/libpsl/README.txt similarity index 72% rename from src/network/kernel/qurltlds_p.h.INFO rename to src/3rdparty/libpsl/README.txt index d6162a2a0d6..5bbd0f57ebd 100644 --- a/src/network/kernel/qurltlds_p.h.INFO +++ b/src/3rdparty/libpsl/README.txt @@ -1,14 +1,14 @@ -The file qurltlds_p.h is generated from the Public Suffix +The file psl_data.cpp is generated from the Public Suffix List (see [1] and [2]), by the program residing at -qtbase/src/3rdparty/libpsl/src/psl-make-dafsa in the Qt source tree. +src/psl-make-dafsa. To regenerate the file, run the following command from qtbase tree: - src/3rdparty/libpsl/src/psl-make-dafsa public_suffix_list.dat src/network/kernel/qurltlds_p.h + src/3rdparty/libpsl/src/psl-make-dafsa public_suffix_list.dat src/3rdparty/libpsl/psl_data.cpp src/3rdparty/libpsl/src/psl-make-dafsa --output-format=binary public_suffix_list.dat \ tests/auto/network/access/qnetworkcookiejar/testdata/publicsuffix/public_suffix_list.dafsa -Those arrays in qurltlds_p.h are derived from the Public +Those arrays in psl_data.cpp are derived from the Public Suffix List ([2]), which was originally provided by Jo Hermans . diff --git a/src/network/kernel/qurltlds_p.h b/src/3rdparty/libpsl/psl_data.cpp similarity index 100% rename from src/network/kernel/qurltlds_p.h rename to src/3rdparty/libpsl/psl_data.cpp diff --git a/src/3rdparty/libpsl/qt_attribution.json b/src/3rdparty/libpsl/qt_attribution.json index f2eddec00dd..ba54c8107a2 100644 --- a/src/3rdparty/libpsl/qt_attribution.json +++ b/src/3rdparty/libpsl/qt_attribution.json @@ -1,3 +1,32 @@ +[ +{ + "Id": "psl-data", + "Name": "The Public Suffix List", + "QDocModule": "qtnetwork", + "Description": "The Public Suffix List is an initiative of Mozilla, +but is maintained as a community resource. It is available for use in any software, +but was originally created to meet the needs of browser manufacturers. +It allows browsers to, for example: + +- Avoid privacy-damaging \"supercookies\" being set for high-level domain name suffixes + +- Highlight the most important part of a domain name in the user interface + +- Accurately sort history entries by site", + + "Files": "psl_data.cpp", + "QtUsage": "Used in Qt Network to avoid setting \"supercookies\" in the cookie jar +supported by Qt (by the QNetworkCookieJar class).", + + "Homepage": "Consult https://github.com/publicsuffix/list for the sha1 but download from ...", + "Homepage": "http://publicsuffix.org/", + "Version": "d17a65633b0286833727ef21e897a22564695ef5, fetched on 2022-05-23", + "License": "Mozilla Public License 2.0", + "LicenseFile": "PSL-LICENSE.txt", + "LicenseId": "MPL-2.0", + "Copyright": "The list was originally provided by Jo Hermans . +It is now maintained on github (https://github.com/publicsuffix/list)." +}, { "Id": "libpsl", "Name": "libpsl - C library to handle the Public Suffix List", @@ -13,3 +42,4 @@ to lookup entries in it.", "LicenseId": "BSD-3-Clause", "Copyright": "Copyright 2014-2016 The Chromium Authors. All rights reserved." } +] diff --git a/src/network/CMakeLists.txt b/src/network/CMakeLists.txt index 8920afa01e1..48f0e737f0c 100644 --- a/src/network/CMakeLists.txt +++ b/src/network/CMakeLists.txt @@ -163,8 +163,9 @@ qt_internal_extend_target(Network CONDITION NOT QT_FEATURE_system_zlib AND NOT n qt_internal_extend_target(Network CONDITION QT_FEATURE_topleveldomain SOURCES kernel/qtldurl.cpp kernel/qtldurl_p.h - kernel/qurltlds_p.h ../3rdparty/libpsl/src/lookup_string_in_fixed_set.c + INCLUDE_DIRECTORIES + ../3rdparty/libpsl ) qt_internal_extend_target(Network CONDITION QT_FEATURE_dnslookup diff --git a/src/network/kernel/qt_attribution.json b/src/network/kernel/qt_attribution.json deleted file mode 100644 index 90151bb0850..00000000000 --- a/src/network/kernel/qt_attribution.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "Id": "psl", - "Name": "The Public Suffix List", - "QDocModule": "qtnetwork", - "Description": "The Public Suffix List is an initiative of Mozilla, -but is maintained as a community resource. It is available for use in any software, -but was originally created to meet the needs of browser manufacturers. -It allows browsers to, for example: - -- Avoid privacy-damaging \"supercookies\" being set for high-level domain name suffixes - -- Highlight the most important part of a domain name in the user interface - -- Accurately sort history entries by site", - - "Files": "qurltlds_p.h", - "QtUsage": "Used in Qt Network to avoid setting \"supercookies\" in the cookie jar -supported by Qt (by the QNetworkCookieJar class).", - - "Homepage": "Consult https://github.com/publicsuffix/list for the sha1 but download from ...", - "Homepage": "http://publicsuffix.org/", - "Version": "d17a65633b0286833727ef21e897a22564695ef5, fetched on 2022-05-23", - "License": "Mozilla Public License 2.0", - "LicenseFile": "PSL-LICENSE.txt", - "LicenseId": "MPL-2.0", - "Copyright": "The list was originally provided by Jo Hermans . -It is now maintained on github (https://github.com/publicsuffix/list)." -} diff --git a/src/network/kernel/qtldurl.cpp b/src/network/kernel/qtldurl.cpp index 06a7df50ba6..7bda9845b95 100644 --- a/src/network/kernel/qtldurl.cpp +++ b/src/network/kernel/qtldurl.cpp @@ -19,7 +19,7 @@ #endif #if QT_CONFIG(publicsuffix_qt) -# include "qurltlds_p.h" +# include "psl_data.cpp" #endif // Defined in src/3rdparty/libpsl/src/lookup_string_in_fixed_set.c diff --git a/sync.profile b/sync.profile index 85fd18147c2..119ab07246f 100644 --- a/sync.profile +++ b/sync.profile @@ -75,8 +75,7 @@ @qpa_headers = ( qr/^qplatform/, qr/^qwindowsystem/ ); my @internal_zlib_headers = ( "crc32.h", "deflate.h", "gzguts.h", "inffast.h", "inffixed.h", "inflate.h", "inftrees.h", "trees.h", "zutil.h" ); my @zlib_headers = ( "zconf.h", "zlib.h" ); -my @internal_qtnetwork_headers = ( "qurltlds_p.h" ); -@ignore_headers = ( @internal_zlib_headers, @internal_qtnetwork_headers ); +@ignore_headers = ( @internal_zlib_headers ); @ignore_for_include_check = ( "qsystemdetection.h", "qcompilerdetection.h", "qprocessordetection.h", @zlib_headers); @ignore_for_qt_begin_namespace_check = ( "qt_windows.h", @zlib_headers); %inject_headers = (