path: root/util
diff options
authorRobert Hogan <>2011-05-24 11:04:27 +0200
committerPeter Hartmann <>2011-05-24 12:12:04 +0200
commit093a92fb03e7c163882d1ba5fbdaf9fabb5bd969 (patch)
tree5b67504e44e34abdd0c1dfc69c73bd8118e6a40b /util
parent6c72eb845657b670af5435ef8084ae91e5dfbbdd (diff)
Add QUrl::topLevelDomain() and move TLD table from QtNetwork to QtCore
Move Qt's copy of the Mozilla public suffix list from QtNetwork to QtCore and use it to expose a new API function QUrl::topLevelDomain(). This function returns the section of the url that is a registrar-controlled top level domain. QtCore now exports a couple of functions to the other Qt modules: qTopLevelDomain, a helper function for QUrl::topLevelDomain(); and qIsEffectiveTLD(), a helper function for QNetworkCookeieJar. The motivation for this new API is to allow QtWebKit implement a Third-Party Cookie blocking policy. For this QtWebKit needs to know the element of the url that is the registry-controlled TLD. Without this knowledge it would end up blocking third-party cookies per host rather than per registry-controlled domain. See also Merge-request: 1205 Task-number: QTBUG-13601 Reviewed-by: Peter Hartmann <> (cherry picked from commit 154402f56dcf8303a6ce601a52215226af8d31ba)
Diffstat (limited to 'util')
-rw-r--r--util/corelib/qurl-generateTLDs/main.cpp (renamed from util/network/cookiejar-generateTLDs/main.cpp)4
-rw-r--r--util/corelib/qurl-generateTLDs/ (renamed from util/network/cookiejar-generateTLDs/
2 files changed, 2 insertions, 2 deletions
diff --git a/util/network/cookiejar-generateTLDs/main.cpp b/util/corelib/qurl-generateTLDs/main.cpp
index 5cdc97cd0c..baaf25632c 100644
--- a/util/network/cookiejar-generateTLDs/main.cpp
+++ b/util/corelib/qurl-generateTLDs/main.cpp
@@ -77,7 +77,7 @@ int main(int argc, char **argv) {
printf(" wget -O effective_tld_names.dat\n");
printf(" grep '^[^\\/\\/]' effective_tld_names.dat > effective_tld_names.dat.trimmed\n");
printf(" %s effective_tld_names.dat.trimmed effective_tld_names.dat.qt\n\n", argv[0]);
- printf("Now copy the data from effective_tld_names.dat.qt to the file src/network/access/qnetworkcookiejartlds_p.h in your Qt repo\n\n");
+ printf("Now copy the data from effective_tld_names.dat.qt to the file src/corelib/io/qurltlds_p.h in your Qt repo\n\n");
QFile file(argv[1]);
@@ -156,6 +156,6 @@ int main(int argc, char **argv) {
- printf("data generated to %s . Now copy the data from this file to src/network/access/qnetworkcookiejartlds_p.h in your Qt repo\n", argv[2]);
+ printf("data generated to %s . Now copy the data from this file to src/corelib/io/qurltlds_p.h in your Qt repo\n", argv[2]);
diff --git a/util/network/cookiejar-generateTLDs/ b/util/corelib/qurl-generateTLDs/
index 9d5f1cf7f9..9d5f1cf7f9 100644
--- a/util/network/cookiejar-generateTLDs/
+++ b/util/corelib/qurl-generateTLDs/