Block-all-connection-requests-with-qjz9zk-in-the-domain-name-or-with-a-trk-scheme.patch

This commit is contained in:
none 2021-03-05 20:17:10 +01:00
parent 382fe6acb7
commit fbbb1c58be

View file

@ -5,10 +5,26 @@ Subject: Block all connection requests with 'qjz9zk' in the domain name or
An info bar is displayed unless the --disable-trkbar command-line flag or the chrome://flag option is used.
This patch is based on Iridium's 'net: add "trk:" scheme and help identify URLs being retrieved'
FILE:Block-all-connection-requests-with-qjz9zk-in-the-domain-name-or-with-a-trk-scheme.patch
---
.../chrome_autocomplete_scheme_classifier.cc | 1 +
chrome/browser/history/history_utils.cc | 1 +
chrome/browser/ui/singleton_tabs.cc | 3 +-
.../omnibox/browser/autocomplete_input.cc | 7 +++--
components/url_formatter/url_fixer.cc | 4 +++
.../child_process_security_policy_impl.cc | 1 +
net/BUILD.gn | 2 ++
net/url_request/trk_protocol_handler.cc | 25 +++++++++++++++
net/url_request/trk_protocol_handler.h | 31 +++++++++++++++++++
net/url_request/url_request.cc | 8 +++++
.../url_request_context_builder.cc | 3 ++
url/url_constants.cc | 1 +
url/url_constants.h | 1 +
url/url_util.cc | 2 ++
14 files changed, 87 insertions(+), 3 deletions(-)
create mode 100644 net/url_request/trk_protocol_handler.cc
create mode 100644 net/url_request/trk_protocol_handler.h
diff --git a/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc b/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc
index d5c3dd451a..431f242e27 100644
--- a/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc
+++ b/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc
@@ -56,6 +56,7 @@ ChromeAutocompleteSchemeClassifier::GetInputTypeForScheme(
@ -20,7 +36,6 @@ index d5c3dd451a..431f242e27 100644
base::LowerCaseEqualsASCII(scheme, url::kDataScheme))) {
return metrics::OmniboxInputType::URL;
diff --git a/chrome/browser/history/history_utils.cc b/chrome/browser/history/history_utils.cc
index 3f54bbb409..8971b7e96a 100644
--- a/chrome/browser/history/history_utils.cc
+++ b/chrome/browser/history/history_utils.cc
@@ -21,6 +21,7 @@ bool CanAddURLToHistory(const GURL& url) {
@ -32,7 +47,6 @@ index 3f54bbb409..8971b7e96a 100644
url.SchemeIs(chrome::kChromeSearchScheme) ||
url.SchemeIs(dom_distiller::kDomDistillerScheme))
diff --git a/chrome/browser/ui/singleton_tabs.cc b/chrome/browser/ui/singleton_tabs.cc
index 6d99c68055..3d4f0ccfae 100644
--- a/chrome/browser/ui/singleton_tabs.cc
+++ b/chrome/browser/ui/singleton_tabs.cc
@@ -99,7 +99,8 @@ int GetIndexOfExistingTab(Browser* browser, const NavigateParams& params) {
@ -46,7 +60,6 @@ index 6d99c68055..3d4f0ccfae 100644
GURL rewritten_tab_url = tab_url;
diff --git a/components/omnibox/browser/autocomplete_input.cc b/components/omnibox/browser/autocomplete_input.cc
index 1a3902c994..294d5980fb 100644
--- a/components/omnibox/browser/autocomplete_input.cc
+++ b/components/omnibox/browser/autocomplete_input.cc
@@ -526,7 +526,8 @@ void AutocompleteInput::ParseForEmphasizeComponents(
@ -71,7 +84,6 @@ index 1a3902c994..294d5980fb 100644
}
return url::FindAndCompareScheme(utf8_input, url::kHttpScheme, nullptr);
diff --git a/components/url_formatter/url_fixer.cc b/components/url_formatter/url_fixer.cc
index 125a2f1e8e..528d03ad06 100644
--- a/components/url_formatter/url_fixer.cc
+++ b/components/url_formatter/url_fixer.cc
@@ -560,6 +560,10 @@ GURL FixupURL(const std::string& text, const std::string& desired_tld) {
@ -86,7 +98,6 @@ index 125a2f1e8e..528d03ad06 100644
if (scheme == url::kFileScheme)
return GURL(parts.scheme.is_valid() ? text : FixupPath(text));
diff --git a/content/browser/child_process_security_policy_impl.cc b/content/browser/child_process_security_policy_impl.cc
index d2d167ebf5..8eec489e7e 100644
--- a/content/browser/child_process_security_policy_impl.cc
+++ b/content/browser/child_process_security_policy_impl.cc
@@ -762,6 +762,7 @@ ChildProcessSecurityPolicyImpl::ChildProcessSecurityPolicyImpl() {
@ -98,7 +109,6 @@ index d2d167ebf5..8eec489e7e 100644
// TODO(nick): https://crbug.com/651534 blob: and filesystem: schemes embed
diff --git a/net/BUILD.gn b/net/BUILD.gn
index d214ac4959..11de6308ee 100644
--- a/net/BUILD.gn
+++ b/net/BUILD.gn
@@ -1086,6 +1086,8 @@ component("net") {
@ -112,7 +122,6 @@ index d214ac4959..11de6308ee 100644
"url_request/url_fetcher_core.cc",
diff --git a/net/url_request/trk_protocol_handler.cc b/net/url_request/trk_protocol_handler.cc
new file mode 100644
index 0000000000..e32409c333
--- /dev/null
+++ b/net/url_request/trk_protocol_handler.cc
@@ -0,0 +1,25 @@
@ -143,7 +152,6 @@ index 0000000000..e32409c333
+} // namespace net
diff --git a/net/url_request/trk_protocol_handler.h b/net/url_request/trk_protocol_handler.h
new file mode 100644
index 0000000000..9fb0b4fa33
--- /dev/null
+++ b/net/url_request/trk_protocol_handler.h
@@ -0,0 +1,31 @@
@ -179,7 +187,6 @@ index 0000000000..9fb0b4fa33
+
+#endif // NET_URL_REQUEST_TRK_PROTOCOL_HANDLER_H_
diff --git a/net/url_request/url_request.cc b/net/url_request/url_request.cc
index bdfc3d8710..148bfbd865 100644
--- a/net/url_request/url_request.cc
+++ b/net/url_request/url_request.cc
@@ -13,6 +13,7 @@
@ -212,7 +219,6 @@ index bdfc3d8710..148bfbd865 100644
net_log_.BeginEvent(NetLogEventType::REQUEST_ALIVE, [&] {
return NetLogURLRequestConstructorParams(url, priority_,
diff --git a/net/url_request/url_request_context_builder.cc b/net/url_request/url_request_context_builder.cc
index d6f1215fa1..a903fc34f5 100644
--- a/net/url_request/url_request_context_builder.cc
+++ b/net/url_request/url_request_context_builder.cc
@@ -44,6 +44,7 @@
@ -233,7 +239,6 @@ index d6f1215fa1..a903fc34f5 100644
#if !BUILDFLAG(DISABLE_FTP_SUPPORT)
diff --git a/url/url_constants.cc b/url/url_constants.cc
index 69399e4200..23b8312deb 100644
--- a/url/url_constants.cc
+++ b/url/url_constants.cc
@@ -28,6 +28,7 @@ const char kMailToScheme[] = "mailto";
@ -245,7 +250,6 @@ index 69399e4200..23b8312deb 100644
const char kWssScheme[] = "wss";
diff --git a/url/url_constants.h b/url/url_constants.h
index f5a33dd813..ee66beb50f 100644
--- a/url/url_constants.h
+++ b/url/url_constants.h
@@ -32,6 +32,7 @@ COMPONENT_EXPORT(URL) extern const char kJavaScriptScheme[];
@ -257,7 +261,6 @@ index f5a33dd813..ee66beb50f 100644
COMPONENT_EXPORT(URL) extern const char kWssScheme[];
diff --git a/url/url_util.cc b/url/url_util.cc
index 49cc6e689f..3772cabe28 100644
--- a/url/url_util.cc
+++ b/url/url_util.cc
@@ -34,6 +34,7 @@ struct SchemeRegistry {
@ -276,3 +279,6 @@ index 49cc6e689f..3772cabe28 100644
};
// Schemes that can be sent CORS requests.
--
2.17.1