summaryrefslogtreecommitdiff
path: root/docshell
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2021-10-22 05:39:02 +0000
committerMoonchild <moonchild@palemoon.org>2022-04-01 16:03:01 +0200
commita95439db61c4530afae3967e2912d6ca38f1bbda (patch)
treeed8926c1fe52c8072dbaff40278c1f0370980c2f /docshell
parentf5fcb8a32ccbe9af1a16a05c4959f7389eae37c1 (diff)
downloaduxp-a95439db61c4530afae3967e2912d6ca38f1bbda.tar.gz
Issue #1822 - Part 3: Remove LOAD_CLASSIFIER_URI and various
helper functions.
Diffstat (limited to 'docshell')
-rw-r--r--docshell/base/nsDocShell.cpp47
-rw-r--r--docshell/base/nsDocShell.h4
-rw-r--r--docshell/base/nsIDocShell.idl3
3 files changed, 8 insertions, 46 deletions
diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp
index c40fbd7a10..55f09d35b1 100644
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -530,9 +530,8 @@ SendPing(void* aClosure, nsIContent* aContent, nsIURI* aURI,
return;
}
- // Don't bother caching the result of this URI load, but do not exempt
- // it from Safe Browsing.
- chan->SetLoadFlags(nsIRequest::INHIBIT_CACHING | nsIChannel::LOAD_CLASSIFY_URI);
+ // Don't bother caching the result of this URI load.
+ chan->SetLoadFlags(nsIRequest::INHIBIT_CACHING);
nsCOMPtr<nsIHttpChannel> httpChan = do_QueryInterface(chan);
if (!httpChan) {
@@ -1560,10 +1559,6 @@ nsDocShell::LoadURI(nsIURI* aURI,
flags |= INTERNAL_LOAD_FLAGS_FIRST_LOAD;
}
- if (aLoadFlags & LOAD_FLAGS_BYPASS_CLASSIFIER) {
- flags |= INTERNAL_LOAD_FLAGS_BYPASS_CLASSIFIER;
- }
-
if (aLoadFlags & LOAD_FLAGS_FORCE_ALLOW_COOKIES) {
flags |= INTERNAL_LOAD_FLAGS_FORCE_ALLOW_COOKIES;
}
@@ -1662,7 +1657,7 @@ nsDocShell::LoadStream(nsIInputStream* aStream, nsIURI* aURI,
nsCOMPtr<nsIURILoader> uriLoader(do_GetService(NS_URI_LOADER_CONTRACTID));
NS_ENSURE_TRUE(uriLoader, NS_ERROR_FAILURE);
- NS_ENSURE_SUCCESS(DoChannelLoad(channel, uriLoader, false),
+ NS_ENSURE_SUCCESS(DoChannelLoad(channel, uriLoader),
NS_ERROR_FAILURE);
return NS_OK;
}
@@ -4993,31 +4988,6 @@ nsDocShell::DisplayLoadError(nsresult aError, nsIURI* aURI,
error.AssignLiteral("nssFailure2");
}
}
- } else if (NS_ERROR_PHISHING_URI == aError ||
- NS_ERROR_MALWARE_URI == aError ||
- NS_ERROR_UNWANTED_URI == aError) {
- nsAutoCString host;
- aURI->GetHost(host);
- CopyUTF8toUTF16(host, formatStrs[0]);
- formatStrCount = 1;
-
- // Malware and phishing detectors may want to use an alternate error
- // page, but if the pref's not set, we'll fall back on the standard page
- nsAdoptingCString alternateErrorPage =
- Preferences::GetCString("urlclassifier.alternate_error_page");
- if (alternateErrorPage) {
- errorPage.Assign(alternateErrorPage);
- }
-
- if (NS_ERROR_PHISHING_URI == aError) {
- error.AssignLiteral("deceptiveBlocked");
- } else if (NS_ERROR_MALWARE_URI == aError) {
- error.AssignLiteral("malwareBlocked");
- } else if (NS_ERROR_UNWANTED_URI == aError) {
- error.AssignLiteral("unwantedBlocked");
- }
-
- cssClass.AssignLiteral("blacklist");
} else if (NS_ERROR_CONTENT_CRASHED == aError) {
errorPage.AssignLiteral("tabcrashed");
error.AssignLiteral("tabcrashed");
@@ -10668,7 +10638,6 @@ nsDocShell::InternalLoad(nsIURI* aURI,
aFileName, aPostData, aHeadersData,
aFirstParty, aDocShell, getter_AddRefs(req),
(aFlags & INTERNAL_LOAD_FLAGS_FIRST_LOAD) != 0,
- (aFlags & INTERNAL_LOAD_FLAGS_BYPASS_CLASSIFIER) != 0,
(aFlags & INTERNAL_LOAD_FLAGS_FORCE_ALLOW_COOKIES) != 0,
srcdoc, aBaseURI, contentType);
if (req && aRequest) {
@@ -10757,7 +10726,6 @@ nsDocShell::DoURILoad(nsIURI* aURI,
nsIDocShell** aDocShell,
nsIRequest** aRequest,
bool aIsNewWindowTarget,
- bool aBypassClassifier,
bool aForceAllowCookies,
const nsAString& aSrcdoc,
nsIURI* aBaseURI,
@@ -11227,7 +11195,7 @@ nsDocShell::DoURILoad(nsIURI* aURI,
}
}
- rv = DoChannelLoad(channel, uriLoader, aBypassClassifier);
+ rv = DoChannelLoad(channel, uriLoader);
//
// If the channel load failed, we failed and nsIWebProgress just ain't
@@ -11323,8 +11291,7 @@ nsDocShell::AddHeadersToChannel(nsIInputStream* aHeadersData,
nsresult
nsDocShell::DoChannelLoad(nsIChannel* aChannel,
- nsIURILoader* aURILoader,
- bool aBypassClassifier)
+ nsIURILoader* aURILoader)
{
nsresult rv;
// Mark the channel as being a document URI and allow content sniffing...
@@ -11394,10 +11361,6 @@ nsDocShell::DoChannelLoad(nsIChannel* aChannel,
break;
}
- if (!aBypassClassifier) {
- loadFlags |= nsIChannel::LOAD_CLASSIFY_URI;
- }
-
// If the user pressed shift-reload, then do not allow ServiceWorker
// interception to occur. See step 12.1 of the SW HandleFetch algorithm.
if (IsForceReloadType(mLoadType)) {
diff --git a/docshell/base/nsDocShell.h b/docshell/base/nsDocShell.h
index 019a7e4ab6..bc5c5eed3f 100644
--- a/docshell/base/nsDocShell.h
+++ b/docshell/base/nsDocShell.h
@@ -386,7 +386,6 @@ protected:
nsIDocShell** aDocShell,
nsIRequest** aRequest,
bool aIsNewWindowTarget,
- bool aBypassClassifier,
bool aForceAllowCookies,
const nsAString& aSrcdoc,
nsIURI* aBaseURI,
@@ -394,8 +393,7 @@ protected:
nsresult AddHeadersToChannel(nsIInputStream* aHeadersData,
nsIChannel* aChannel);
nsresult DoChannelLoad(nsIChannel* aChannel,
- nsIURILoader* aURILoader,
- bool aBypassClassifier);
+ nsIURILoader* aURILoader);
nsresult ScrollToAnchor(bool aCurHasRef,
bool aNewHasRef,
diff --git a/docshell/base/nsIDocShell.idl b/docshell/base/nsIDocShell.idl
index d2812bd9c9..0e3c4f1996 100644
--- a/docshell/base/nsIDocShell.idl
+++ b/docshell/base/nsIDocShell.idl
@@ -110,7 +110,8 @@ interface nsIDocShell : nsIDocShellTreeItem
// @see nsIWebNavigation::LOAD_FLAGS_FIRST_LOAD
const long INTERNAL_LOAD_FLAGS_FIRST_LOAD = 0x8;
- const long INTERNAL_LOAD_FLAGS_BYPASS_CLASSIFIER = 0x10;
+ // 0x10 is unused
+
const long INTERNAL_LOAD_FLAGS_FORCE_ALLOW_COOKIES = 0x20;
// Whether the load should be treated as srcdoc load, rather than a URI one.